Workplace from Facebook

Using the Dialogflow Facebook Workplace integration, you can create a Workplace from Facebook bot to interact with your end-users.

Limitations

Only the default agent language is supported by this integration.

How it works

This is how the integration works:

  • You configure the Dialogflow integration and Workplace instance, so that they communicate with each other.
  • The Dialogflow integration sends messages to the end-user by using the Messenger API from Facebook.
  • The Dialogflow integration receives messages from the end-user by acting as the Workplace Webhook from Facebook.

Start

To start the integration:

  1. Register a Workplace instance if you don't have one, and make sure you are the System Admin of the group.

  2. Enable the integration from the Dialogflow Console:

    1. Go to the Dialogflow ES console.
    2. Click Integrations in the left sidebar menu.
    3. Click Workplace from Facebook.
    4. Click START and you will be redirected to Workplace to finish the installation:
      • Log into your Workplace account. The account needs to be a System Admin on Workplace to install integrations.
      • Click Add to Workplace in the pop-up window that asks you to install Dialogflow integration. You also have the option to customize the name for the bot.
  3. Test your app:

    1. Go to Workplace and log into the account.
    2. Find Dialogflow (or the customized name of your bot) in Bots from the Home section of the sidebar and start chatting with the bot.

Cancel

If you clicked the START button but do not want to finish the installation on Workplace:

  1. Go to the Dialogflow ES console.

  2. Click Integrations in the left sidebar menu.

  3. Click Facebook Workplace:

    1. If you see a CANCEL button: Click CANCEL to cancel the installation.
    2. If you see a STOP button: Follow instructions below to uninstall the integration.

Stop

To stop a successfully installed integration:

  1. Go to the Dialogflow ES console.

  2. Click Integrations in the left sidebar menu.

  3. Click Facebook Workplace.

  4. Click STOP and you will be redirected to Workplace to finish the installation:

    1. Log into your Workplace account. The account needs to be a System Admin on Workplace to uninstall integrations.
    2. Find and select the Dialogflow integration from the installed integrations on Workplace, click Uninstall to finish the uninstallation.
  5. Dialogflow integration will be uninstalled.

Rich response messages

This integration translates some rich response messages messages to Facebook Messenger Platform message types.

Image responses

Image responses are sent to Facebook Messenger as Facebook Messenger file attachment messages. The message.attachment.type value is set to image. The following formats are supported:

  • jpg
  • png
  • static gif
  • animated gif

Card responses

Card responses are sent to Facebook Messenger as Facebook Messenger generic templates.

Quick reply responses

Quick reply responses are sent to Facebook Messenger as Facebook Messenger quick replies.

Custom payload responses

To send other types of Facebook Messenger messages, you can use a custom payload.

The general format of the custom payload looks like:

{
  "facebook": {
    message
  }
}

In place of message, provide the Facebook Messenger message object. For details of the message object, see the Facebook Messenger API reference.

For example:

  • Send an audio link:
    {
      "facebook": {
        "attachment": {
          "type": "audio",
          "payload": {
            "url": "https://example.com/audio/test.mp3"
          }
        }
      }
    }
        
  • Send a playable video:
    {
      "facebook": {
        "attachment": {
          "type": "video",
          "payload": {
            "url": "https://example.com/video.mp4"
          }
        }
      }
    }
        
  • Send a file:
    {
      "facebook": {
        "attachment": {
          "type": "file",
          "payload": {
            "url": "https://example.com/file.pdf"
          }
        }
      }
    }
        

Limitations

  1. A Dialogflow agent can only be installed on one Workplace instance, but you can install multiple Dialogflow agents on one Workplace instance.

  2. To remove a failed installation, you need to both cancel the installation on Dialogflow and remove the installation on Workplace.

Migration

If you are using Messenger integration and you are going to migrate it to Workplace integration, you'll need to:

  1. Stop the Messenger integration.

  2. Remove the callback_url on the Facebook app by reversing steps in Setting Up Your Facebook App.

  3. Start the Workplace integration following steps above.