Lab 1. Create and Configure Dialogflow CX Virtual Agent.
Objective
In the labs, you'll use Dialogflow CX Virtual Agent to transfer the call to a Queue, check the balance, and use Google and third pary AIs to respond to general questions.
Below is the functional diagram of the flow you will build in this lab.
Task 1. Create new Virtual Agent.
Step 1. Open a Chrome web browser, navigate to the Dialogflow CX portal Dialogflow CX, and log in using your user credentials.
Step 2. Select the project CL2024AMS.
Note: Please be aware that on some following screenshots, you might see another project in the instructions. However, you need to make sure to use CL2024AMS project.
Step 3. Click on Create agent.
Step 4. Click on Build your own.
Step 5. Name your Virtual Agent by following the format {YourName}_{UserID}_Bootcamp_VA. Change the location to global (Global serving, data-at-rest in US)
Task 2. Navigate to Dialogflow CX Agent flow builder and customize the initial greeting.
Step 1. In the Dialogflow CX builder click on Start Page.
Note: In Dialogflow CX, a page is a set of instructions that holds one or more related conversational turns. It represents a single step in a conversation flow, and it can contain various types of content, including text responses, prompts for user input, fulfillment actions, and more. Pages are connected together to create a conversation flow that guides the user through a conversation with the Dialogflow CX agent.
Step 2. In the Start Page click on Default Welcome Intent route. On the right window, scroll down and delete all the default Agent responses and click on the field to Enter agent dialog.
Note: A route is a mapping between an intent and a specific page or flow within a conversation. Routes define how a conversation should flow based on the user's input and the intent that is matched.
Step 3. Provide your customized message to let the caller know that they reached to an organization which provides sales services of Webex Contact Center. You can type something like “Hello! Thank you for calling. Here we know all about Contact Centers.” In Dialogflow CX, the changes are not saved automatically, so you would need to save the page every time you make a change.
Note: Agent responses are the messages or actions that an agent sends back to the user or caller during a conversation. When a user or caller sends a message or makes a request to a Dialogflow CX agent, the agent analyses the input and determines the appropriate response to send back.
Step 4. Test the agent response that you just created. Click Test Agent and type a greeting message, for example type “hello”.
Task 3. Configure Google Phone service.
Step 1. Click on Manage and then select Integrations
Step 2. For CX Phone Gateway, click on Manage.
Step 3. Create new phone number.
Step 4. Request the number.
Step 5. Provide the name for your integration. Select the number from the list and click Save.
Step 6. You should see the voice integration was created. Call the number from your cellphone and you should hear the initial greeting.
Task 4. Create a new page to collect the caller’s name
Step 1. Close Start Page and Test Agent windows and click “+” to create new page. Name the page Caller_Name and confirm the creation.
Step 2. Connect Start page and Caller_Name page. For this, click Default Welcome Intent route on Start Page. Scroll down on the right side and select that you would like the conversation to go to the next page.
Step 3. From the drop-down list, select Caller_Name page. Don’t forget to Save the change.
Step 4. Configure Caller_Name page to collect name from the caller and store it in the parameter. In the Caller_Name page click Entry fulfillment and type a message where you ask the caller’s name. Click Add and Save the change.
Note: Entry fulfilment is needed to provide a message to the caller once the call moved to a new page to let the caller know where they are in the conversation and set right expectations.
Step 5. While on Caller_Name page, click on Parameters, type Name as the parameter’s name, select @sys.any from the list of preconfigured Entities and click Save.
Note: A parameter is a named entity or value that is extracted from user input during a conversation. Parameters can be used to store information that is relevant to the user's request, such as their name, date of birth, or preferred language. Parameters can also be used to pass data to other parts of your application such as Contact Center.
Step 6. Configure Routes in Caller_Name page. Click Routes, on the right window scroll down to Condition and set the condition $page.params.status = "FINAL". Click Save.
Note: A condition in Dialogflow Routes configuration is a rule or set of rules that define when the route should be triggered. The condition can be based on various factors such as user input, context, parameters, and session data.
By setting this condition, we expect the call to move to the next page, once Name parameter created in the previous step is filled with a value. For example, the caller said – “Nick”, then the call should move to the next forward.
Step 7. Using the Test Agent option on the right top side, test if the flow is working as designed at this point.
Task 5. Configure the flow to send call to a live Agent.
Step 1. Configure Agent_Balance_GenQuestion page and connect Caller_Name page to it.
Step 2. Select the page Agent_Balance_GenQuestion and click on the Entry fulfillment section. In the Agent say section type "Hi $session.params.Name, please let me know if you would like to talk to an Agent, check your current balance, or have a general question."
Step 2. Create a New page with the name Agent_Handoff
Step 3. Click on Agent_Balance_GenQuestion page, add new Route, under the Intent section select create new Intent. Name the intent as agent_handoff, and add Training phrases like "Agent", "Representative", and "Human".
Step 4. Make sure you see the intent is selected as agent_handoff and to complete the Route configuration scroll down and select Transition page Agent_Handoff.
We will complete the live Agent Handoff configuration in the next session when we will work on the integration configurations between Dialogflow, Webex Contact Center and UCCE
For now, just use the Test Agent option and call the Google number that you configured for this Virtual agent to test the current configurations
Task 6. Configure the balance lookup branch.
Step 1. Download the file with preconfigured intents using the link below.
https://cisco.app.box.com/s/rcrqylakrqw4iqw5z8nyqu27jwvzyz57
You don't need to log in to download the file. Just click X on the login page.
Step 2. Go to Manage section, select Intents and click on Import.
Step 3. Select the Upload option and find the file that you just downloaded.
You should see additional Intents were uploaded that we will be using in the following Tasks and steps.
Step 4. Create new page with name Balance.
Step 5. Click on Agent_Balance_GenQuestion page and add new Route. Select balance intent and in the Transition section select the Balance Page. Save the Route.
Step 6. Create new Webhook in Dialogflow CX portal.
- Click Manage
- Select Webhooks and click on "Create new"
Step 7. Configure Webhook to place API request and retrieve Balance information which depend on the caller ANI.
- Display name: Balance_Webhook
- Webhook timeout: 5
- Type: Generic web service
- Webhook URL: https://66a4801c5dc27a3c19090b94.mockapi.io/clients?AccountID=$session.params.AccountID
- SubType: Flexible
- Method: Get
- Use Webhook Template: Off
- Response configurations:
- Parameter name:Balance
- Field path:$.[0].Balance
- Save the new Webhook.
Step 8. (Read Only. Informational). Understand the Webhook URL and Parse process of the Webhook you just configured.
- For this lab we are utilizing free mockAPI tool which allows us to build JSON structured data with access to it over REST API calls.
- On the screenshot below you can see the JSON data as a list of objects; each has Balance, AccountID, and id fields.
- For us to parse the Balance for the correct account we use AccountID as the Parameter Key and the Parameter Value
- This Parameter Value in Dialogflow CX can be found using the following path: $session.params.AccountID
- In the Response configuration’s part, we parse output using the expression $.[0].Balance and save under the Dialogflow new variable with name Balance
- This variable Balance can be found using the path $session.params.Balance.
- You will use this variable later in this lab

Step 9. Configure new Route for Webhook execution.
- Open **Balance** page, create new **Route**
- Set the condition as $page.params.status = FINAL
- Scroll down and enagle Webhook. Select the Webhook you just created from the list and in the Tag* section type "Test".
- In The Agent says section Type "Your balance is $session.params.Balance dollars" and click on Add the response.
- Save the Route
Step 10. Configure the Balance page to collect AccountID information.
- Open Balance page, click on Entry fulfillment and type "Please enter you account ID". Add the response and Save the page settings.
- While on Balance page, add Parameter, name it "AccountID", select Entity type @sys.number and Save the settings.


Step 11. Create a new page with the name "More_Questions?".
Step 12. Click on Balance page, select the Route you have created in the Step 9, and in the Transition section connect it to More_Questions?
Step 13. Click on More Question? page, create new Route, select intent Yes, scroll down to Transition section and connect it to "Agent_Balance_GenQuestion page.
Step 14. Click on More Question? page, create new Route, select intent No, scroll down to Transition section and connect it to End Session Page
Step 15. While on More Question? page, click on Entry fulfilment and add the message "Do you have any more questions?"
Step 16. Click on Test agent
Step 17. The problem will arise if you respond that you have more questions and will enter another account number. You will still recive the results related to the account number you entered previously. It does not automatically overwrite the value of the entity/parameter. As you can see on the screenshot below it doesn't asked me to enter the AccountID as it is already filled.
To resolve the issue you need to clear the values of the parameters as soon as the interaction reaches Agent_Balance_GenQuestion page. To do so you need to use Parameter presets option in the Entry fullfilment and set it up as null for accountid and Balance parameters.
Step 18. Test it again. You should be prompted to enter the AccountID and receive the Balance details related to the AccountID.
Task 7. Configure Google Generative AI to answer any questions related to WxCC.
Dialogflow CX Generator LLM works by analyzing input from users, understanding context, and generating responses. Trained on vast text data, it crafts human-like replies for Dialogflow CX chatbots, making conversations feel natural and dynamic. This can significantly reduce Virtual agent design time and improve agent quality.
Step 1. Create new page with the name "General Question".
Step 2. Open up Agent_Balance_GenQuestion page, add a new Route, select intent general_question. Scroll down to the transition and connect it to General Question page.
Step 3. Open General Question page, click on Entry fulfillment and in the Agent says section type "What would you like to know about Webex Contact Center?". Click on Add and Save the change.
Step 4. While on General Question page, add Parameter, name it "Google_Question", select type as @sys.any.
Step 5. Open up the Manage section, and create new Generator.
Step 6. Name it “Google_Generator”. In the Text prompt enter the following: "Only in 30 words response the following question related to Cisco Webex Contact Center $Google_Question". Save changes.
Step 7. Go to Build and select Google Generator page. Click on add new Route. On the right side scroll down until you will see Generators. Click on Add generator and select the one you just created from the list. Continue configuring as in next steps before saving.
Step 8.In previous steps, under the Google Generator Text prompt, you specified $Google_Question. Now configure this parameter ($Google_Question) under Input parameters - $session.params.Google_Question. Once the Generative AI completes generating the content, it will store it in the Output parameter. $request.generative.Google_Answer. Continue configuring as in next steps before saving the Route.
Step 9. To response to the user with the AI generated data enter the Output Parameter $request.generative.Google_Answer in the Agent Says field. Click Add.
Step 10. To complete the page configuration, you need to specify Intent or Condition and optionally the Transition if we need to continue the conversation. Let’s configure the Condition as $page.params.status = FINAL. Select the Transition with More_Question? page. Save the page.
What does the above configuration do? As soon as you ask your question:
The Condition will be triggered.
Response will be generated as output parameter and it will be shared with the caller using Agent says where we using output parameter.
The interaction also will move to More_Question? page for further operations.
Step 11. Go to Agent_Balance_GenQuestion page and add configure Google_Question and Google_Answer parameters values to be cleared once the interaction enter this page.
Step 12. Test you Virtual Agent. Once you ask a question, Google AI will generate the answer.
Task 8. Configure Generative Fallback.
Generative Fallback in Dialogflow CX is an AI feature designed to handle situations where the conversational agent encounters user input that it cannot understand or properly respond to. For example, the user request doesn’t meet any Intents. In such cases, instead of providing a generic error message or failing to respond, the generative fallback mechanism generates a response based on its understanding of the context and the conversation so far.
(Doc: https://cloud.google.com/dialogflow/cx/docs/concept/generative/generative-fallback)
Step 1. Test your agent how it behaves by default if you ask anything which is not configured in the flow. Type "Hi", and provide your name on the following question. Then try the following: For example type:
“Who are you?”, “Can you repeat my options?”, “Hold on a minute”, “Resume”.
Step 2. By default, if user phrases doesn’t meet any intent or parameter condition, the sys.no-input-default Event Handler will be used. This event handler configured in the Start page. There are a list of the “Agent says” response, such as “I don’t get that. Can you say it again?” and so on.
Step 3. To Enable Generative Fallback, Go to Start Page. Click on sys.no-match-default Event Handler and on the right side. You will see option “Enable generative fallback”. Checkmark the option and save the changes.
Step 4. Test the Agent with the same phrases: “Who are you?”, “Can you repeat my options?”, “Hold on a minute”. You will notice human-like responses that are more aligned with the expected customer experience.
Task 9. Configure Generative Fallback.
By default, Generative Fallback use preconfigured Template which mainly configured to address the following queries:
- Greet and say goodbye to the user.
- Repeat what the agent said in case the user didn't understand.
- Hold the line when the user asks for it.
- Summarize the conversation.
You can customize the template to address your specific queries.
Step 1. On the right top corner click on Agent settings. Select Generative AI. Select Generative Fallback setting.
Step 2. Click on Templates and select to create new Template.
Step 3. Name the template Custom_Template
Provide the following prompt:
You are a friendly agent that likes to help with Webex Contact Center related questions. You are under development, and you can only help $flow-description
Currently you can $route-descriptions The conversation between the human and you so far was: ${conversation USER:"Human:" AGENT:"AI"} Then the human asked: $last-user-utterance You say:
Save the new Template.
Step 4. Then Save the Agent Settings.
Step 5. Test virtual agent. Start with “Hi” and then ask: “How are you doing today?”, “What is Webex Contact Center?”. You can see the virtual agent generate and provide responses using LLM on the page that is not configure with a Generator or OpenAI integration.