Google Assistant Adapter

This document explains how to use the Google Assistant Adapter adapter.


In your botfuel project, run :

npm install --save botfuel-module-adapter-assistant



Create a new config file in the root directory of your project (e.g. assistant-config.js)

module.exports = {
  adapter: {
    name: 'assistant',
  modules: ['botfuel-module-adapter-assistant']


In order to make your bot work with the assistant, you need to create an action.json file.

  "actions": [
      "description": "Default Welcome Intent",
      "name": "MAIN",
      "fulfillment": {
        "conversationName": "<YOUR_APP_NAME>"
      "intent": {
        "name": "actions.intent.MAIN",
        "trigger": {
          "queryPatterns": [
            "talk to <YOUR_APP_NAME>"
  "conversations": {
    "<YOUR_APP_NAME>": {
      "name": "<YOUR_APP_NAME>",
      "url": "<YOUR_BOT_URL>/webhook"
  "locale": "en"

Once your have this file, you need to deploy it using the gactions CLI.

gactions update --action_package action.json --project <YOUR_GOOGLE_ACTIONS_PROJECT_ID>

For more information on how to use gactions, visit this link

You can then run your bot with your new config file.


If you use Windows Powershell, use this command instead:


Message types supported

The assistant adapter supports the following types of messages:

  • BotImageMessage
  • BotTextMessage
  • CardsMessage
  • QuickRepliesMessage
  • UserTextMessage

Adapt your bot

In order to make your bot compatible with Google Assistant, you need to follow certain rules.

Should I stay or should I go?

Depending on the situation, you may want to close the conversation or let it open. By default, a conversation is closed right after the bot responds, except in certain specific cases like QuickReplies.

You can force your bot to wait for an answer with the question parameter

new BotTextMessage("How are you doing?", {question: true});

Assistant required parameters

Some Google Assistant message types require specific parameters. For example, in addition to the card list, cards require a text and a speech. You can add them as a second parameter of the CardMessage constructor.

new CardsMessage(cards, { speech: 'Hello', text: 'Hello' })

See Module Overview for more information on how to create and use a module.