Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Automatically hitting an intent

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!

0 1 215
1 REPLY 1

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:

  • Webhook Response (In Operating Hours): {"isNotOperatingHours": false, "intent": "InOperatingHours"}
  • Webhook Response (Out of Operating Hours): {"isNotOperatingHours": true, "intent": "OutOperatingHours"}

Then, in your Dialogflow CX flow:

  • Route Conditions: Keep your existing route conditions based on isNotOperatingHours.
  • Intent Setting: After the route condition, use a Set Parameter node to set the intent parameter. This parameter will now accurately reflect the status. You would do this on both the "In Office Hours" and "Out of Office Hours" routes.

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.