First published: Nov 2017 | Last updated: May 2022
Sometimes I see questions like these in the Dialogflow forum.
So, I got one intent working. How can I now “move” the conversation to the next intent?
In Intent1, declare an output context called contextA. In the next intent you want to fire, use contextA as the input context. You have now chained Intent1 and Intent2 using contextA.
Is that all?
There is quite a bit more. But that’s the basic idea for every intent you are trying to chain into the conversation.
Let us take the example of the follow up intent tutorial, and use it as an example.
You cannot use follow up intents in all scenarios. Learning this technique will help you in such situations. Under the hood, what I am describing here uses the same idea. Also, this technique usually makes it easier to maintain your chatbot.
Add a new intent called addwebsitechatbot and add the following details. Set the output context as await_name and change the lifespan to 1
Now add another intent called userprovidesname and add await_name as the input context and await_email as the output context. The training phrase will be an example name, such as John Smith. You have now “chained” the two intents together as I have described.