You can transfer a conversation from you AI agent to an automation.
Example Use Cases
Since this method simply triggers a webhook automation, the sky is the limit on what you can do. But here are a few examples of what's possible:
Trigger an automation based on a Keyword: If a user says a particular keyword in chat, the AI can transfer the conversation over to an automation.
Collect Leads: The AI can ask the users questions, and when the user has answered, it can save that data in a custom field.
Notify Team Members: The AI can send notifications to team members for certain events, like a lead being captured.
And Much More!
How to Set This Up
Part 1: Creating/Updating Your Automation
The first thing you need to do is create your automation for WhatsApp/Instagram, like the one below:
You can learn about creating automations here.
Next, change the trigger of the automation to "Webhook":
Finally, copy the webhook URL. We're going to need it later.
Part 2: Setting Up an AI Custom Action
Now we're going to use a custom action to trigger this automation via Webhook.
For this, go to your AI Agent > Actions > Create Custom Action
This will open a modal for you to configure this custom action. Follow these steps to first define your action:
Give your Action an Appropriate Name, like
Trigger_Automation_on_Keyword
Next, tell the AI when it should use this action. For keyword automatoins, you can write:
Use this action when anytime the user says the keyword: "apple"
. Be as specific and verbose as possible.Under Available Channels, ONLY select the channels for which you've created your automation. So if you've created this automation for WhatsApp, select WhatsApp and nothing else.
Next, under Parameters, define the parameters you need to send to the automation. For example, if you've asked the AI to save people's addresses, then create a parameter for "Address". You can create parameters by clicking "Add" on the top-right.
The following parameters are always required when triggering an automation:
Name:
Phone
| Type:String
| Description:Phone number of the User with Country Code
Name:
Name
| Type:String
| Description:Name of the User
Once you've filled all of this, click Next. This will take you to a screen where you can configure your webhook.
In the Request Configuration Section, make sure that the request type is set to
POST
and paste the webhook link we copied from the trigger of our automation in Part 1.In the Request Body Section, click on Edit Body.
Then, click "Add Field". It should add an empty field with the words
Key
andValue
What you need to do is create a key for each parameter you need in your automation. If you want to send address, create a key for address and map it to the address parameter.
The following keys and values are always required when triggering an automation:Key:
phone
| Value: Click +Param and select "Phone
". This is the parameter we created in step 4.Key:
name
| Value: Click +Param and select "Name
". This is the parameter we created in step 4.
Your Request Body should look like this:
Hit Save
Finally, hit Save Action or Update Action on the bottom right, and you're done!
Now, every time your defined condition is fulfilled (based on your prompt), the AI will trigger a Spur automation.