Triggering a flow using DialogFlow
In DialogFlow (formerly api.ai), create a new agent.
Call it TestAgent
and click Save. Click Create Intent.
Call the intent cancel
. Under User says, add the following user expressions:
Click Save. At the top of the left-hand menu bar, click the settings symbol.
Copy the client access token. In Meya, create a new bot and add a flow called test
. Enter the following code.
states:
start:
component: meya.text
properties:
text: It works!
For the flow's trigger, set the trigger type to API_AI
. Paste your client access token in the client_access_token field. Set language to en
. Finally, set intent to cancel
.
Your settings should look like this:
Press OK and save the flow. Now we're ready to test our bot!
In the chat test window, type hi
. In the debug window at the bottom, you should see No matching intent
. This is because our text did not meet the default 0.67 confidence level our flow's intent requires.
Now type how do I cancel
. The bot should respond It works!
.
You now know how to trigger flows using DialogFlow!
Updated over 6 years ago