How to use the Autopilot Studio Widget
Twilio Autopilot will be shut down on August 25, 2023.
Twilio Autopilot will be disabled for all users on August 25, 2023. After this date, customers won’t be able to access the Autopilot APIs, Console Experience, Studio Widget, and docs. Additionally, Twilio will discontinue including Autopilot support in the new helper library releases and customer support won’t answer tickets or requests regarding Autopilot after Feb 25, 2023. For full details, including migration options, see Autopilot Support at Twilio.
Autopilot widget can only be used with Incoming Message and Incoming Call triggers.
The Studio integration for Autopilot does not support images as part of the show action if you are using Chat. The Body text will still be sent to the recipient.
Triggering an Execution via the REST API is not currently supported for Autopilot.
Twilio Autopilot does not officially support the Conversations API as a channel.
The Autopilot Studio Widget lets you send calls or messages from Studio to an Autopilot bot and back to Studio after the session with the bot ends.
In this guide you will learn how to:
- Add Autopilot variables into Studio Flows
- Use a Studio flow to hand off conversations from Autopilot bots to human agents
- Use Autopilot with Flex
You can also check out the Autopilot Widget reference documentation
Add Autopilot variables into Studio Flows
Using the Autopilot Widget lets you leverage data from a conversation with an Autopilot bot, like data from Memory or Field Types in the Studio Flow. This is especially useful when you use a bot to collect data from the user and need to make decisions in Studio based on that.
You can access the following Autopilot variables in Studio Flows:
Variable |
|
|
|
For example: "I want to book an appointment for 4 in the afternoon" |
For example: 16:00 |
For example: Time |
|
|
|
|
|
|
|
Handoff from Autopilot to human agents
With Autopilot and Studio you can handoff a conversation from an Autopilot bot to a human agent on any channel following the steps below:
- Create a
talk-to-agent
Task for your Autopilot bot - Train the
talk-to-agent
Task - Program the
talk-to-agent
Task - Insert a Split Widget after the Autopilot Widget on the
end_session
transition - Evaluate the Autopilot Current Task variable in the Split widget
- Connect to an agent
1. Create a talk-to-agent
Task on Autopilot
Go to the Tasks section of Autopilot and create a talk-to-agent
Task.
2. Train the talk-to-agent
Task on Autopilot
Once the task is created, click on Train and add the samples below:
- Talk to agent please
- representative
- agent
- I want to talk to someone
- talk to a person
- talk to representative
- agent please
3. Program the talk-to-agent
Task on Autopilot
Then click on Program, to define what happens when the task is invoked. Enter the following JSON:
{
"actions": [
{
"say": "Hold on, we are connecting you with an agent"
}
]
}
Note that the task does not have a listen: true
, meaning that the Autopilot session will end and it will send control back to Studio.
4. Insert a Split widget after the Autopilot widget on end_session trasition
You only want to send to agents Autopilot sessions that end on the talk-to-agent
Task. To check for this, you'll need to create a Split Widget after the Autopilot end_session
transition.
5. Evaluate the Autopilot CurrentTask
variable in the Split widget
Here you need to create a condition in the Split Widget to check if the task is talk-to-agent
. You will end up with two transitions from the widget — one for if the CurrentTask
matches talk-to-agent
and another when the it does not match.
6. Connect to Agent
Lastly, you need to connect the talk-to-agent transition to the appropriate widget.
- For Voice use the Connect Call To Widget
- For SMS, Chat and Messaging Channels like WhatsApp use the Send and Wait for Reply Widget
Use Autopilot with Flex
You can also use Autopilot and Flex by adding the Send to Flex Widget to do human agent handoff.
Using Inbound Context with Studio
Inbound Context lets you add data to the Autopilot Memory before starting a dialogue with the bot. In a Studio flow, it allows you to pass Flow variables created by other widgets in your flow seamlessly into Autopilot to be used in bot conversations. You can then parse these variables directly from the Memory JSON included in Autopilot's request to your application:
- Memory.CarMake
- Memory.CarModel
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.