Configure Dialogflow CX Agent with WxCC
The objective of this lab is walk you through the steps required to configure the connector for the Dialogflow CX integration with Webex Contact Center.
The configuration for the Dialogflow CX connector should be done on Google and on the Webex side. Please see the diagram and the required steps below.
Google Dialogflow CX portal Webex Control Hub
1. Create Virtual Agent 3. Configure Google Contact Center AI config
2. Create Conversation Profile 4. Create Contact Center AI config (Virtual Agent)
Task 1: Assign the agent that you created to the Conversational profile.
A Dialogflow conversation profile is a set of configuration settings that define the behavior of the virtual agent in a conversation with a customer. Your project must have enabled the Data Labeling API in order to be able to create a Conversation profile.
- Open up the Virtual Agent that you created in the previous lab. On the left top corner, click Menu. From the Menu options, select Agent Assist. In the next window click on Conversation profile under DATA section.
- Now create new Conversation profile for your lab.
- Create the name for your Conversation profile using the following format {YourName)_Conversational_Profile.
- Select the Language
- Scroll down, Enable virtual agent for this Conversation profile.
- Click on the Agents field and select the agent which you created in the previous task and then click Create.
- Once the conversation profile is created, copy the profile ID and past it to a notepad or just know that this is the place where you can get Conversation Profile ID as you will need it later in this lab when configuring the AI config in Webex Control Hub.


Note: If you don't see a specific agent when enabling virtual agent in a conversation profile, make sure that you have selected the right location in the URL.
Task 2. Configure Google Contact Center AI connector.
- Log in to Webex Control Hub (https://admin.webex.com) using your user account, select Contact Center service and open Connectors.
- You will see Google Contact Center AI card. This connector is used specifically for Dialogflow CX agents.
- When creating the Connector you need to provide or select the CCAI project name, Cisco-provided project name, and the Google Cloud Service Account.
- Only users with permissions to Cisco Project can create this connector. For security reasons, the users for this lab don’t have such permission so this connector is preconfigured for you. You will use the connector Dialogflow CX in the next task.
Note: A JSON key is required for Google project authentication. This GCP JSON key is created automatically in the Cisco Project when the Google Contac Center AI Connector is created.
Task 3. Create Contact Center AI config.
- In Webex Control Hub go to Contact Center service
- Select Feature and click New. On the next window select Contact Center AI Config.
- Give the name for the feature using the following format {YourName}_WxCC_Virtual_Agent.Contact Center AI Connector - Integration Connector. Select Dialogflow CX as the Google Contact Center AI Connector and paste the Conversation profile ID that you got previously in Task 4.
- You should see now the Feature was created.
Task 4. Configure Virtual Agent with the WxCC Flow.
Step 1. Open up Contol Hub, go to Contact Center, click on Flows. Search for the flow with name "Bootcamp_Virtual_Agent_Flow". Make a copy of it.
Step 2. Find your Copy and open the flow and open it.
Step 3. Rename the flow name with your name in front.
Step 4. Click on Virtual Agent block. On the Right side select the AI config that you created in the Task 3. Select the Virtual Agent. Validate and Publish the flow.
Step 5. Go to CH. Open the Channel Google_CCAI_(1-5) . Assigned the flow you just created. Save the channel and call the number associated with the Channel. You should hear the VA response.
Task 5. Send Data from WxCC flow to Dialogflow CX Virtual Agent.
By default, once Cisco initiates the connection with Dialogflow CX virtual Agent it sends a "Hello" message. "Hello" is one of the training phrases of the Default Welcome Intent. See picture below.
The Start Page is configured with a Route that uses this Default Welcome Intent.
So for now it is configured to play messages and send the call to Caller_Name page.
By using State Events in the Virtual Agent block you can trigger a custom event, pass data from WxCC to Dialogflow VA or do both in the same time.
There are a lot of use cases for this feature. Let's build a simple one where we want to trigger the event by informing the caller that the business is closed and disconnecting the call.
Step 1. Click on Virtual Agent block and under Event Name type Afterhours. Publish the flow.
Step 2. Open up your Dialogflow VA, click on the Start Page, and add a new Event handler. Apply the checkpoint to use custom event, in the Agent says field type something like "Thank you for calling. The office is currently closed" and click Add.
Step 3. Scroll down on the Event handler settings, and select the Transition to End Session. Save the changes.
Step 4. Place the call at your entry point, you should hear the message that the office is closed and the call will be disconnected.
Step 5. You can also pass information from WxCC to Dialogflow CX using JSON data structure. Just for a test lets pass the ANI of the call to Dialogflow CX. Click on Virtual Agent block and in the Event Data field enter the following:
{ "PhoneNumber":"{{NewPhoneContact.ANI}}" }
Where {{NewPhoneContact.ANI}} is the dynamic flow variable that changes depending on the caller's ANI.
Step 6. In Dialogflow CX VA, click on the Aftrhours Event handler. Delete the previous message, and add new message: Thank you for calling from $session.params.PhoneNumber. The office is currently closed.
$session.params.PhoneNumber is the parameter or you can call it session variable that was created after we send it from the WxCC State Events.
Step 7. Call the number. You should hear the caller number but not in the expected format. It will say "Thank you for calling from 13 billion....
Step 8. To customize the Text-to-Speech response you need to use SSML structured data. Here is the SSML Google doc: https://cloud.google.com/text-to-speech/docs/ssml
Go to the Afterhours Event handler and replace the message with the following.
<speak>
Thank you for calling from
<say-as interpret-as='telephone' google:style='zero-as-zero'>$session.params.PhoneNumber</say-as>
The office is currently closed.
</speak>
Step 8. Place the test call to you application and you should hear the expected response.
Task 6. Understand Handled output in Virtual Agent block.
If the interaction goes to End Session and you don't specify in the Agent Responses that this is Live agent handoff, the interaction comes out from Handle output on the WxCC side.
Like we configured the Afterhours Event handler with just Text type Agent response and the Transition the interaction to the End Session, it comes out from the Handle output.
To check go to the flow. Click on debut and check your last interaction. You will see the interaction came out from the Handle Output.
While sending the interaction to Handled output you can also transfer some data using Custom payload. We will do a similar exercise in the next Task.
Task 7. Understand Escalate output in Virtual Agent block.
Escalate output is usually used when you want to do agent handoff.
In this Task, you will see how metadata can be sent from Dialogflow to the Webex Contact Center for routing decisions. Specifically we will send the call to Technical Support queue or Sales queue depending on the customer response.
Step 1. Go to your Dialogflow CX virtual agent and open up Agent_Hadnoff page. Click on add new Route.
Step 2. Scroll down to the Agent responses in the Agent says field type: "Thank you, the call will be moved to Technical Support Queue". Add the response.
Step 3. Click on Add dialog option. Select Live agent handoff, add the following body:
{ "dialogflow.ccai.live-agent-escalation": { "Type_Of_Agent": "TAC" } }
Scroll down to the Transition and select End Session page. Save the page settings.
Step 3. Create an additional page for the Sales live agents queue.
Use Sales intent.
In the Agents Says field type the following "Thank you, the call will be moved to Sales Queue"
In the Live agent handoff body add the following JSON data.
{ "dialogflow.ccai.live-agent-escalation": { "Type_Of_Agent": "Sales" } }
Step 4. While in the Agent_Handoff page, click on the Edit Fulfillment and type "Would you like to talk to a Technical support engineer or Sales agent?"
Step 5. Open up the flow and understand how the parse data is configured to route the call to the TAC or Sales queue depending on the caller's response.
- Using the JSON path we extract the value that associated with the key Type_Of_Agent. You can test the JSON path using the online tool https://jsonpath.com/
- The extracted value will be assigned to the Flow Variable with name Queue_Routing.
- In the case note we test against the variable Queue_Routing.
- Depends on the result the call will move to the TAC or Sales queue.
Step 5. Go to VirtualAgent block, open up State Events. Remove the value for Event Name so we proceed with regular Virtual Agnet config. Publish the flow.
Step 6. Place two calls. Request talk to an agent and in the question about what kind of agent first time say Technical support and on the second call say Sales.