App Basics

Actions on Google lets you extend the functionality of the Google Assistant with actions. Actions let users get things done through a conversational interface that can range from a quick command to turn on some lights or a longer conversation, such as playing a trivia game.

To extend the Google Assistant, you build an app with these steps.

Create an Actions on Google developer project

Go to the Actions on Google Developer Console and create a developer project. The project lets you define metadata about your app and manage and track your app through the approval process. Once you have a project, you can create an action package that defines all your actions.

Create actions in an action package

You create actions in your action package by mapping an intent to fulfillment. An action defines an entry point into your app's functionality and maps an intent that describes the action to the fulfillment that processes the intent.

For example, say you wanted to build an app that contained actions to purchase some goods, check the status of orders, and to show some daily deals. You can define intents that are triggered by saying:

  • "Ok Google, talk to My Favorite Shoe Store"
  • "Ok Google, talk to My Favorite Shoe Store to buy some shoes"
  • "Ok Google, talk to My Favorite Shoe Store to check on my order"
  • "Ok Google, talk to My Favorite Shoe Store to show me today's deals"

The action package might look something like this:

{
  "actions": [
    {
      "name": "MAIN",
      "intent": {
        "name": "actions.intent.MAIN"
      },
      "fulfillment": {
        "conversationName": "sekai-app"
      }
    },
    {
      "name": "BUY",
      "intent": {
        "name": "com.example.sekai.BUY",
        "parameters": [{
          "name": "color",
          "type": "SchemaOrg_Color"
        }],
        "trigger": {
          "queryPatterns": [
            {"queryPattern": "find some $SchemaOrg_Color:color sneakers"},
            {"queryPattern": "buy some blue suede shoes"},
            {"queryPattern": "get running shoes" }
          ]
        }
      },
      "fulfillment": {
        "conversationName": "sekai-app"
      }
    },
    {
      "name": "ORDER_STATUS",
      "intent": {
        "name": "com.example.sekai.ORDER_STATUS",
        "trigger": {
          "queryPatterns": [
            {"queryPattern": "check on my order"},
            {"queryPattern": "see order updates"},
            {"queryPattern": "check where my order is" }
          ]
        }
      },
      "fulfillment": {
        "conversationName": "sekai-app"
      }
    },
    {
      "name": "DAILY_DEALS",
      "intent": {
        "name": "com.example.sekai.DAILY_DEALS",
        "trigger": {
          "queryPatterns": [
            {"queryPattern": "hear about daily deals"},
            {"queryPattern": "buying some daily deals"},
            {"queryPattern": "get today's deals" }
          ]
        }
      },
      "fulfillment": {
        "conversationName": "sekai-app"
      }
    }
  ],
  "conversations": {
    "sekai-app": {
      "name": "sekai-app",
      "url": "https://sekai.example.com/sekai-app"
    }
  }
}

Build and Deploy Fulfillment

When an action in your app is invoked, it calls fulfillment to start a conversation with users to fulfill the action.

In every request to your fulfillment, you receive the user input as a text string. To process the intent, you typically parse the text input and return a response. This back and forth exchange happens many times until your fulfillment has enough information to complete the action.

Submit your app for approval and make it available to users