This feature is currently available as a Public Beta product and information contained in this document is subject to change. This means that some of the features are not yet implemented and others may be changed before the product is declared as Generally Available. Public Beta products are not covered by a Twilio SLA.
Not a HIPAA Eligible Service
Virtual Agent for the Conversations channel is not a HIPAA Eligible Service and should not be used in Flex workflows that are subject to HIPAA.
Studio uses Widgets to represent parts of Twilio's API. You can combine Widgets in a Studio Flow to build robust applications that require no coding on your part.
The Connect Virtual Agent Widget allows you to connect a Twilio Voice call or Conversations chat to a Google Dialogflow CX agent. You can leverage a native integration between Twilio Voice and Dialogflow CX to provide customers with conversational AI experiences for Voice and Conversations channels.
This Widget is specifically for Conversations channels for Flex along with the Voice channel. If you only need to use the Voice channel for Flex, see Connect Virtual Agent Widget.
The integration includes live agent handoff and customer barge-in. Twilio provides the telephony aspect of the conversational IVR experience and Dialogflow CX enables agent configuration, including setting intents, sentiment analysis, speech models, and agent responses.
You can use the integration to handle incoming Conversations chats and, based on the escalation intent, route them to live agents and relevant services. Agents and supervisors can also access previous messages exchanged by the Virtual Agent and customer.
The integration works with the following channels:
- Webchat 3.0
- Google Business Messages
- Facebook Messenger
If you would like to use the Connect Virtual Agent Widget with Flex for both Conversations and Voice, contact our support team for help enabling this Beta feature.
To use the Connect Virtual Agent Widget, you must connect your Dialogflow CX agent to Twilio in the Google Dialogflow CX cloud console. Review the prerequisites and steps for the integration in the Dialogflow CX Onboarding Guide.
After you complete the integration, Twilio automatically creates a new Studio Flow containing a Connect Virtual Agent Widget that is connected to your Dialogflow CX agent. The Incoming Call trigger is automatically attached to the Widget. To use the Widget with Conversations channels, you can adjust the trigger to Incoming Conversation.
Note: If you want to use both Voice and Conversations, you need a separate Widget for each. Make sure that you match each trigger with the corresponding Widget. For example, Incoming Call connects to the Widget using Voice.
The Connect Virtual Agent Widget requires the connector name for the Google Dialogflow CX instance. You can find the Connector Name in the Dialogflow CX Connector in the Twilio Console after you have completed the one-click telephony integration in the step above.
|The unique name configured in your Dialogflow CX connector instance.
|The channel you want to use for your widget: Voice or Conversations
Editing the Connector Name within the Connect Virtual Agent Studio Widget alone will break the integration between Dialogflow and your Twilio project. If you need to update the Connector Name, you must edit it in the Dialogflow CX Connector and the Studio Widget.
The Connect Virtual Agent Widget accepts a number of Voice channel configuration options that you can use to configure agent calls and analysis.
|Status Callback URL
|URL to send status callback events from Twilio
|Status Callback Method
|The HTTP method to use when requesting the statusCallback URL. Accepted values are GET or POST.
|Key-value pairs used to send custom session parameters to your virtual agent to drive personalization and/or parameterize your agent’s response
|Key-value pairs used to override underlying connector properties (e.g. language, sentimentAnalysis, voiceName, welcomeIntent, etc.) and/or modify your virtual agent’s default behavior
For Conversations channels, you can configure the Connect Virtual Agent Widget with the following:
|Virtual Agent Timeout
|How long the Virtual Agent should wait for a reply from an unresponsive customer before the Timeout transition is triggered.
These events trigger transitions from this Widget to another Widget in your Flow. For more information on working with Studio transitions, see this guide.
|The Dialogflow CX agent ended the connection because an intent matched the "end of the conversation" intent indicating the call completed successfully
|Live Agent Handoff
|The Dialogflow CX agent returned a live agent handoff response indicating the call needs to be escalated to a human agent
|Hangup (Voice only)
|The caller hung up during the Dialogflow CX agent interaction
|Timeout (Conversations only)
|The conversation timed out because the Virtual Agent had to wait too long for a reply from a customer
|An error occurred during VirtualAgent processing
When the Connect Virtual Agent Widget executes, it will have stored the following variables for use throughout your Studio Flow (where
MY_WIDGET_NAME is the name of your actual Widget). For more information on working with variables in Studio, see this guide.
|Liquid Template Language
VirtualAgentErrorCode will be present if status is failed (if the Widget ends through the Failed transition).
VirtualAgentProviderError may also be provided if
VirtualAgentErrorCode is 32601.
For Google Dialogflow CX agent, the VirtualAgentProviderData JSON object may contain the following information. Note that this variable might be empty if the Widget exited through the Failed transition.
|ConversationId: Unique identifier for this conversation provided by Google
|Unique identifier for the end user participant provided by Google
|Parameters included from the Dialogflow CX Agent if the Live Agent Handoff Transition was triggered