Triggering a flow using DialogFlow

In DialogFlow (formerly api.ai), create a new agent.

151

Call it TestAgent and click Save. Click Create Intent.

146

Call the intent cancel. Under User says, add the following user expressions:

1164

Click Save. At the top of the left-hand menu bar, click the settings symbol.

303

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:

795

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!.

354

You now know how to trigger flows using DialogFlow!