Hi there! I'm creating a prototype of a telecommunications chatbot in Dialogflow CX. Part of my agent is an Agent Assist flow, where I am checking if the user's request is within operating hours. I am accomplishing this using a webhook which returns a parameter (isNotOperatingHours). This parameter is then used as a condition to direct the user to one of two routes.
I am able to do this perfectly fine. But my project requirements also entail that an intent is matched, such as 'InOperatingHours' or 'OutOperatingHours'. I believe this is so that monitoring can be done of which intents are hit the most. I attempted this by setting the routes' target pages to a new page, e.g In Office Hours. I then added a route with the intent (with no training phrases) as well as a condition 'true'. But it seems that this intent is not hitting because the agent response for the route is not returning.
Does anyone have any advice regarding how to trigger the intent in such a way that doesn't require user input? Thank you in advance!
Hi @jj_17,
Welcome to Google Cloud Community!
You’re correct, setting a route with only a true condition and an intent won't reliably trigger the intent. In Dialogflow CX, intent matching occurs before the route conditions are evaluated. Since your webhook already determines the operating hours, you're attempting to trigger an intent match after the decision has been made. This is why your InOperatingHours and OutOperatingHours intents aren't being logged. With regard to the issue you are encountering, here are some things you can consider to address the issue:
Modify the Webhook Response:
This approach is to have your webhook also set the intent. Instead of just returning isNotOperatingHours, return both that parameter and the appropriate intent name as another parameter. For example:
Then, in your Dialogflow CX flow:
This method utilizes the existing logic in your webhook, eliminating the need for additional routes just for intent tracking. You can then use the intent parameter in your reporting and analytics to monitor which state occurs most frequently.
I hope the above information is helpful.