Define Actions

To define Actions in Dialogflow, you create intents in your Dialogflow agent and assign them as entry points into your Action. You can create the following types of Actions:

  • Default Action: Every Dialogflow agent must have one and only one Action that's invoked when users ask for your Action by name (for example "Ok, Google. Talk to Facts about Google" or "Ok, Google. Let me talk to Facts about Google")
  • Additional intents to deep link into your conversation: These Actions are triggered when users invoke your Action by its name and specify an Action invocation phrase (for example "talk to Facts about Google for history facts").

See Invocation and Discovery for more information on how these invocation models work.

Define a default Action

Every Dialogflow agent must have one and only one intent that handles the GOOGLE_ASSISTANT_WELCOME event. This intent is triggered when users invoke by Action name (for example, "Ok Google, talk to Facts about Google").

You can define the GOOGLE_ASSISTANT_WELCOME event in the following ways:

From the intent editor:

  1. Click on Intents in the left navigation.
  2. Select the intent that you want to set the welcome event for.
  3. In the Events section of the intent editor, enter GOOGLE_ASSISTANT_WELCOME.

From the Actions on Google integration screen:

  1. Click on Integrations in the left navigation and then click the Actions on Google card. The Actions on Google view displays.
  2. In the Welcome Intent field, select the intent that you want to set the welcome event for. When you view the intent in the intent editor, you should see that Dialogflow automatically sets the GOOGLE_ASSISTANT_WELCOME event.

You'll most likely want to enable fulfillment for the intent as well. When an intent is triggered, fulfillment processes the intent and returns a response. By default, Dialogflow doesn't call your fulfillment and can return static responses. This might be enough for simple Actions or ones that always respond with the same message when invoked. You can specify static responses in the Response area of the intent if you don't need fulfillment to generate the response.

To enable fulfillment for the welcome intent:

  1. Scroll to the bottom of the intent editor for your welcome intent.
  2. Click Fulfillment and select Enable webhook call for this intent.

See Build Fulfillment for information on how to handle this intent when it's triggered.

Define additional Actions

You can provide additional Actions that act as entry points into your conversation. This lets users disambiguate their intent by letting them specify more details about what they want to do (for example, "talk to Facts about Google to find me history facts").

To define additional Actions in Dialogflow:

  1. Create an intent for each Action that you want to create.
  2. Declare the patterns that trigger the Action in the Training phrases field. For example, if you want users to be able to say the following Action invocation:

    • Invocation 1: "talk to Facts about Google to find me history facts"

    you'd declare an intent with Training phrases like:

    "find me history facts", "look up history facts", "get me facts about history of the company", "read me some headquarters facts", "tell me a few facts about its headquarters"

    We recommend around 10 Training phrases for each intent that defines an Action.

  3. To enable fulfillment for the welcome intent, scroll to the bottom of the intent editor for your welcome intent, click Fulfillment, and select Enable webhook call for this intent.

    See Build Fulfillment for information on how to handle this intent when it's triggered.

  4. Save your intent.

  5. Once you have the intents that you want to use for Action invocation, you need to set them as Additional triggering intents in Dialogflow:

    1. Click on Integrations in the left navigation and then click the Google Assistant card. The Actions on Google view displays.
    2. In the Implicit invocation area, add all the deep link invocation intents that you created.

When defining Actions, the following restrictions and guidelines apply:

  • Don't specify "reserved" wording from name invocation or Action invocation and "trigger phrases". For example, don't use "talk to <action name>", "talk to", "let me talk to", etc.
  • Don't specify Training phrases that contain only a @sys.any entity. You should be much more specific, such as find recipes for @sys.any.

Handling unrecognized Actions when users invoke your Action

When users specify an Action that your Action doesn't recognize, Dialogflow can trigger an intent to handle these cases. To enable this behavior, create a new intent with an input context of google_assistant_welcome and specify the appropriate responses to users:

  1. In the left navigation of Dialogflow, click Intents.
  2. Click the Create Intent button.
  3. In the Contexts section, specify google_assistant_welcome as the input context. Make sure you hit the Enter key so the context is properly set. After you’ve entered your input context, google_assistant_welcome will appear as an output context as well. Click the "x" to remove that output context.
  4. Specify responses that are appropriate for an unrecognized Action in the Response, such as "I'm sorry, I don't know how to help with that."
  5. Click Save.