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 invocation phrase (for example "talk to Facts about Google for history facts").

Define a default Action

Dialogflow Tip

Because Dialogflow supports many products, there are
welcome event triggers for specific platforms, such as
GOOGLE_ASSISTANT_WELCOME for Actions. The generic
WELCOME event lets you handle invocations across many platforms
if you are deploying to many of them.

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:

Click on Intents in the left navigation.

Select the intent that you want to set the welcome event for.

In the Events section of the intent editor, enter GOOGLE_ASSISTANT_WELCOME.

From the Actions on Google integration screen:

Click on Integrations in the left navigation and then click
the Actions on Google card. The Actions on Google view displays.

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:

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.

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:

Create an intent for each Action that you want to create.

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 invocation phrases:

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.

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.

Save your intent.

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

Click on Integrations in the left navigation and then click the
Google Assistant card. The Actions on Google view displays.

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 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:

In the left navigation of Dialogflow, click Intents.

Click the Create Intent button.

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.

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

Click Save.

Note: While you can use Dialogflow to handle simple text responses as a fallback,
you can turn on Enable webhook call for this intent and handle more
advanced fulfillment in your webhook code.