Tutorial 5 - Gracefully handling operating hours during handoff
Gracefully handling operating hours in bot-to-humans handoff
Last updated
Gracefully handling operating hours in bot-to-humans handoff
Last updated
NOTE: this tutorial uses Dialogflow just as an example for a programmatic external chatbot integration. If you instead need to easily embed your Dialogflow Agent in your conversations, please use the Tiledesk Dialogflow Connector, the out-of-the-box Dialogflow integration that doesn't require programming skills.
We'll start from Dialogflow Tutorial 1, just adding a small library to our original endpoint.
You must use the code in Tutorial 1. The code is available on Github here.
Fork the tutorial code using the Fork button. Now you have a copy of the tutorial on your own repo.
What happens if, while you switch to the human operator, your support team is outside of operating hours? The request will be placed in the unserved queue and will became served as soon as your team became available again. Meanwhile you should notice to the user that the request will be taken in some hours, or probably the day after. So, telling "I'm putting you in touch with an operator" is not enough.
How can you write an handoff message that depends by operating hours? You can mix Dialogflow messages fulfillment and Tiledesk APIs to reach your goal.
Open Dialogflow dashboard on your agent, the in the menu fulfillment option enable "Webhook" option. In the URL field insert your heroku app url where you pubblished your app followed by /dfwebhook and your project_id:
This "webhook" endpoint is already provided in the script.
This endpoint uses a projeect_id in the webhook URL that you must have care to replace with your own.
Fulfillment is not automatically actvive on the intents. You must activate it for each intent that you want to reply dynamically. We will re-train the 'talk to agent' intent to use our webhook to reply, instead of the static response.
Switch to the intent UI from Dialogflow dashboard, the go on the form bottom and switch to "on" the fulfillment button, as in the following picture:
Now go on your project in Tiledesk dashboard and activate operating hours, taking care to put offline the interval when you ask the bot to switch to human agents. If you will try to switch to human operators during offline hours you will get the following message:
Do you have feedback on this article? Please send us your feedback writing an email to info@tiledesk.com
Enjoy Tiledesk!