Try the new Conversation API Playground to learn more about using our API!

Actions 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 Action with these steps.

Create an Actions project

Go to the Actions Console and create a project.The project lets you define metadata about your Action and manage and track your Action 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 to start conversations, along with a unique identifier called the intent which maps to a fulfillment that processes the intent.

For example, say you wanted to build an project 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": "org.schema.type.Color"
        }],
        "trigger": {
          "queryPatterns": [
            "find some $org.schema.type.Color:color sneakers",
            "buy some blue suede shoes",
            "get running shoes"
          ]
        }
      },
      "fulfillment": {
        "conversationName": "sekai-app"
      }
    },
    {
      "name": "ORDER_STATUS",
      "intent": {
        "name": "com.example.sekai.ORDER_STATUS",
        "trigger": {
          "queryPatterns": [
            "check on my order",
            "see order updates",
            "check where my order is"
          ]
        }
      },
      "fulfillment": {
        "conversationName": "sekai-app"
      }
    },
    {
      "name": "DAILY_DEALS",
      "intent": {
        "name": "com.example.sekai.DAILY_DEALS",
        "trigger": {
          "queryPatterns": [
            "hear about daily deals",
            "buying some daily deals",
            "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 project is invoked, Actions on Google calls your 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 project for approval and make it available to users

Sample project

If you would like to explore a complete project, see the Say A Number sample.