I tried searching for the resolution and been stuck on this problem for a few days. I am using actions-on-google (nodeJS) and dialogflow to make a chatbot
Here is a sequence:
1. Choose between food and drinks
2. If food:
----------- does it have to be gluten free?
----------- does it have to vegeterian
----------- Confirm order
----------- Would you like a drink with it?
----------- If yes, go to drink intent and pass food params too. (This is the step I am basically stuck at)
3. If drink,
----------- If coming from food, add it to order
----------- which drink?
----------- confirm order
4. Order placed successfully.
I am unable to move from followups to main intent. Is there a way to do so? conv.followup only worked for child followups.
Intents represent what the user says or does and not how you respond to what they're saying. So in this case, it doesn't really make sense to say that you want to "trigger" the drink Intent.
Instead, you'd ask if they want a drink and, if they say "yes", you would prompt them for the drink they want. Similarly, if they just said up front that they wanted a drink, you'd prompt them for their drink selection. These are two different Intents, but they get the same response and then continue down the same path.
You can't "pass parameters" the way you might be thinking, but you can store values in the parameters of a Context (or in the session storage, if you're developing an Action). One good technique is to build the order and store it in a Context as you go, and then when you're all done, get the values from the Context to confirm and place the order.
Contexts are also commonly used to choose a scope for processing answers - Intents with an Input Context require that Context to be set in order to be triggered. Followup Intents use this to limit when that Intent becomes valid, so you can set that Context yourself during Fulfillment.
(You also don't need to use the Followup Intent Contexts - you can handle this using Contexts you manage yourself.)