Rate this page:

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:

You can also check out the Autopilot Widget reference documentation

Autopilot Studio Wdiget

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:



The last Autopilot Task before the conversation with the bot ended.


The Autopilot session identifier. It is 34 characters long, and always starts with the letters UK.


The unique user identifier coming from the channel. For Voice and SMS it will be the user's phone number.


The last thing the user said to the Autopilot bot.

For example: "I want to book an appointment for 4 in the afternoon"


The key-value pair of the field value recognized from last thing the user said. A different key-value pair will be sent for each field value.

For example: 16:00


The key-value pair of the field type recognized from last thing the user said. A different key-value pair will be sent for each field type.

For example: Time


A URL to the Dialogue JSON payload that contains the context and data collected during the Autopilot session.


The channel the interaction is taking place.


The answer to an Autopilot Collect question.


The data type of the Autopilot Collect question.


True if the Autopilot Collect question was answered, false otherwise.


The number of attempts it took the user to answer the question.


A variable stored in the Autopilot Memory using the Remember Action.

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:

  1. Create a talk-to-agent Task for your Autopilot bot
  2. Train the talk-to-agent Task
  3. Program the talk-to-agent Task
  4. Insert a Split Widget after the Autopilot Widget on the end_session transition
  5. Evaluate the Autopilot Current Task variable in the Split widget
  6. 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.

Autopilot Studio Widget

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.

Autopilot Studio Widget

6. Connect to Agent

Lastly, you need to connect the talk-to-agent transition to the appropriate widget.

Autopilot Studio Handoff

Use Autopilot with Flex

You can also use Autopilot and Flex by adding the Send to Flex Widget to do human agent handoff.

Autopilot and Flex

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

Studio Inbound Context.png

Rate this page:

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.

Loading Code Sample...

        Thank you for your feedback!

        Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

        Sending your feedback...
        🎉 Thank you for your feedback!
        Something went wrong. Please try again.

        Thanks for your feedback!