Connect Virtual Agent

Virtual Agent is in Public Beta. Learn more about Twilio's beta product support here.

Studio uses Widgets to represent various parts of Twilio's API that can then be stitched together in your Studio Flow to build out robust applications that require no coding on your part.

New to Twilio Studio? Check out our Getting Started guide!

The Connect Virtual Agent Widget allows you to connect a Twilio Voice call to a Dialogflow Essentials (ES) agent.

You can leverage a native integration between Twilio Voice and Google’s Dialogflow ES to provide callers with conversational experiences through their Interactive Voice Response (IVR). Twilio provides the telephony aspect of the conversational IVR experience, and Dialogflow ES manages agent configuration, including intents and responses, via the Dialogflow ES console or Dialogflow APIs.

Connect Virtual Agent widget screenshot

Connect your Dialogflow ES agent to Twilio from the Dialogflow ES console. Choose the "Twilio" One-Click Telephony integration in the Integrations section of the Dialogflow ES console, and follow the prompts to complete the setup. Once the integration is complete, you can use Twilio to manage the flow of your calls and configured connections to Dialogflow ES agents.

When you first connect a Dialogflow ES agent to Twilio via the One-Click Integration, Twilio will create a new Studio Flow containing a Connect Virtual Agent widget. When a call comes in to the Twilio number you've configured for the integration, Twilio will connect the call directly to this Studio Flow and route the caller to the Dialogflow agent.

You can modify this Flow by adding widgets before and after the Connect Virtual Agent widget. Additionally, once you have connected a Dialogflow ES agent to Twilio using the One-Click Telephony integration, you can then add a Connect Virtual Agent widget for that Dialogflow ES agent to other Studio Flows.

Note that you cannot pass information back and forth between Twilio Studio and the Dialogflow agent. This Widget allows you only to connect a Twilio Voice call to a Dialogflow agent, and then resume the call Flow once the caller has stopped speaking with the Dialogflow agent. If you need to modify what happens during the Dialogflow agent conversation, you should do so in the Google Dialogflow console.

Required Configuration for Connect to Virtual Agent

The Connect to Virtual Agent Widget requires the connector name for the Google Dialogflow ES instance.

Name Description Default
Connector Name Configured in Dialogflow ES connector instance in the Unique Name Field. Appears as "Unique Name" in the connector. empty

Editing the Connector Name within the Connect Virtual Agent Studio widget alone will break the integration between Dialogflow ES and your Twilio project. If you need to update the Connector Name, you must edit it in the Dialogflow ES Stream Connector and the Studio widget.

Optional Configuration for Connect to Virtual Agent

The Connect to Virtual Agent Widget also accepts a number of configuration options that you can use to configure agent interactions and analysis.

Name Description Default
Language Language to be used by Dialogflow ES agent. Defaults to the language provided in the Dialogflow ES connector configuration.
Sentiment Analysis Whether sentiment analysis should be enabled or not. Defaults to the sentiment analysis setting in the Dialogflow ES connector configuration.
Status Callback URL URL to post status callbacks from Twilio. empty

Connect to Virtual Agent Transitions

These events trigger transitions from this Widget to another Widget in your Flow. For more information on working with Studio transitions, see this guide.

Name Description
Return Fired when the Dialogflow ES agent ends the connection because an intent matched the "end of the conversation" intent.
Hangup Fired when the caller hangs up during the Dialogflow ES agent interaction.

Learn More

Now that you know the basics of the Connect to Virtual Agent Widget, you may want to learn more about connecting Twilio with your Google Dialogflow Agent:

We can't wait to see what you build!

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.

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!

Refer us and get $10 in 3 simple steps!

Step 1

Get link

Get a free personal referral link here

Step 2

Give $10

Your user signs up and upgrade using link

Step 3

Get $10

1,250 free SMSes
OR 1,000 free voice mins
OR 12,000 chats
OR more