Google Assistant Routines execute multiple Actions with a single command, perfect for those times when users wake up in the morning, head out of the house, get ready for bed or many of the other tasks they perform throughout the day. After someone engages with your Action, offer a Routine suggestion that lets users add your Action to their Routines.
Set up Routine suggestions
To configure one of your Action's intents for Routine suggestions, follow these instructions:
Prepare a triggering intent
Configure one of your Action's intents as a triggering intent. This intent is added to users' Routines when they follow your suggestion. When a user runs their Routine, the intent triggers and the Routine continues from there.
Your triggering intent's fulfillment should provide the response and then end the conversation without any additional user interaction. When calling an intent as part of a Routine, Assistant automatically trims its response to end the conversation.
To define a triggering intent in Dialogflow, follow these steps:
- In the Dialogflow Console, click on Integrations.
- Under the Google Assistant section, click on Integration Settings.
- Under Discovery > Implicit invocation, click on Add intent and select your triggering intent if it's not already there.
- Turn on Auto-preview changes if it's not already enabled.
- Click Close.
In the Actions SDK, define your triggering intent in the Action package.
To turn on Routine suggestions for your triggering intent, follow these steps:
- In the Actions console, navigate to Develop > Actions.
- Select your triggering intent. If your intent doesn't appear in the list, make sure it's configured as a triggering intent and Dialogflow's Assistant integration is set to auto-preview changes.
- Scroll down to the User engagement section and turn on Would you like to offer routine suggestions to users.
- Enter a Content title.
- Click Save.
You've now configured your Action to suggest your intent for a Routine.
Test Routine suggestions
To test your Routine suggestions using a Google Assistant-enabled mobile device, follow these steps:
- Make sure you're using the Google account that you used to build your Action.
- Invoke your Action.
- Interact with your Action; then, end the conversation.
- Select the Routine suggestion chip. If you don't see this chip, test your Action again, but invoke different intents throughout the conversation.
- Follow the prompts to add the Action to a Routine.
- Start the Routine on your device, and make sure your Action is invoked.