Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Dialogflow CX Onboarding Guide


Twilio's Dialogflow CX Connector is a native telephony integration with Google Dialogflow CX aimed at enterprises with medium to large sized contact centers. Through this integration, Twilio enables customer applications with rich conversational AI experiences.

This guide walks through the process of integrating your Twilio application with your Google Dialogflow CX virtual agent.


Prerequisites

prerequisites page anchor

These prerequisite steps are required prior to starting the one-click integration:

Set up your Google Dialogflow CX agent

set-up-your-google-dialogflow-cx-agent page anchor

Check out Google's Dialogflow CX setup(link takes you to an external page) documentation on how to start using Dialogflow in Google Cloud.

Grant Twilio Permissions to access your Dialogflow CX agent

grant-twilio-permissions-to-access-your-dialogflow-cx-agent page anchor

This one-time manual step is required prior to initiating one-click integration. You will need to provide Twilio's production service account permission to run your Dialogflow agent:

Log in to the Twilio Console

log-in-to-the-twilio-console page anchor

Before performing the one-click integration with Google Dialogflow, you should be signed into the Twilio Console(link takes you to an external page) and logged into the account or sub-account you wish to use with your Dialogflow CX agent integration.


Connect Twilio to your Dialogflow CX Agent with the one-click integration

connect-twilio-to-your-dialogflow-cx-agent-with-the-one-click-integration page anchor

Once you have completed the prerequisite steps, you are ready to use the one-click integration to connect your Twilio Dialogflow CX Connector to your desired Dialogflow CX agent.

Configuration steps within the Google Cloud Console

configuration-steps-within-the-google-cloud-console page anchor
  1. Log in to your Google Dialogflow CX cloud console(link takes you to an external page) and click Manage on the left navigation bar
  2. Select Integrations from the Manage menu
  3. Under the One-click Telephony options, select Twilio
    Twilio under the One-click telephony integrations in the Dialogflow CX agent Manage console.
    Node.js
    Python
    C#
    Java
    PHP
    Ruby

    _12
    const VoiceResponse = require('twilio').twiml.VoiceResponse;
    _12
    _12
    const response = new VoiceResponse();
    _12
    const connect = response.connect({
    _12
    action: 'https://myactionurl.com/twiml'
    _12
    });
    _12
    connect.virtualAgent({
    _12
    connectorName: 'project',
    _12
    statusCallback: 'https://mycallbackurl.com'
    _12
    });
    _12
    _12
    console.log(response.toString());

    Output

    _10
    <?xml version="1.0" encoding="UTF-8"?>
    _10
    <Response>
    _10
    <Connect action="https://myactionurl.com/twiml" >
    _10
    <VirtualAgent connectorName="project" statusCallback="https://mycallbackurl.com"/>
    _10
    </Connect>
    _10
    </Response>

    See the <VirtualAgent> documentation for more information about how to use this TwiML noun.


Support for Dialogflow CX features

support-for-dialogflow-cx-features page anchor

When you configure the Dialogflow CX Connector within Twilio, you can specify a welcome intent. When Twilio connects a call to your Dialogflow CX agent, this welcome intent will trigger (for example, saying "Hello" to the caller before they start speaking). You can use the Dialogflow CX agent's default welcome intent(link takes you to an external page) called "WELCOME" and configure it in your Dialogflow CX Connector. You can edit this default welcome intent within Dialogflow.

You can pass custom parameters to the Dialogflow CX agent either within the Connect Virtual Agent Studio Widget or from the <VirtualAgent> TwiML noun. You can also configure parameters in your agent's setting in the Google Cloud console(link takes you to an external page).

End the conversation with an agent

end-the-conversation-with-an-agent page anchor

In your Dialogflow CX console, you can set the transition target for an intent to "End" to indicate that the conversation with the agent should end after a particular virtual agent response. For more information, check out the Google docs(link takes you to an external page).

If you are using TwiML and the virtual agent ends the conversation because an intent matches the "end of the conversation" intent indicating the call completed successfully, the VirtualAgentStatus field in the request to your action URL is set to completed. This will execute the next TwiML in your application by using the action parameter, or the next TwiML step <Connect> verb.

If you are using Connect Virtual Agent Studio Widget and the virtual agent ends the conversation because an intent matches the "end of the conversation" intent, the Completed transition state is triggered.

If the virtual agent was not able to fulfill the call, Dialogflow CX now allows you to escalate it to a live human agent. Twilio's support for status callbacks allows us to pass requests containing information on call status, intents triggered, sentiment scores, agent-caller text, and more to your application URL, which would enable you to write custom code against it and build a live agent hand-off experience in your own contact center application.

For more details on how to enable the live agent handoff inside the agent fulfillment within your Dialogflow CX console, check out Google docs(link takes you to an external page).

If you are using TwiML and the Dialogflow CX agent returns a live agent handoff response indicating the call needs to be escalated to a human agent,the VirtualAgentStatus field in the request to your action URL is set to live-agent-handoff.

If you are using Connect Virtual Agent Studio widget and the Dialogflow CX agent returns a live agent handoff response indicating the call needs to be escalated to a human agent, the Live Agent Handoff transition state is triggered..

You can enable Barge-in within Dialogflow CX agents, which allows callers to interrupt the virtual agent anytime. If barge-in is enabled and a caller starts speaking in the middle of the agent's response, Dialogflow will stop sending audio to the caller and process the caller's next input.

For more details on how to turn on the barge-in feature, check out these Google docs(link takes you to an external page).

In addition to speech input, an end user can provide a DTMF (Dual-tone multi-frequency signaling) input through their telephone keypad. You can configure DTMF(link takes you to an external page) for a parameter in your Google Dialogflow CX console. Once enabled, your customer can use their telephone keypad to provide parameter values for an agent using a telephony integration(link takes you to an external page).


We are looking forward to hearing from you! Please reach out to your Twilio Account Manager or contact our Sales Team(link takes you to an external page). We're looking for feedback on:

  • Developer experience
  • Level of configurability
  • Status callbacks
  • Ease of transferring control of the call back to Twilio (to execute the next TwiML)
  • Regional implications
  • Applicable use cases

Rate this page: