Google Chat steps
Flow Designer has built-in steps to help you integrate Google Chat into your event management and incident response flows.
The following steps are available:
- Post Simple Message (webhook): send a simple text message that appears inline like any other chat message.
- Post Card Message (webhook): display a card in chat with sections, a title, subtitles, images, and other widgets.
- Post Text Message: send a text message to a Google Chat space. This step requires you complete a few prerequisite steps before using.
- Create Chat Space: create a new Google Chat space. This step requires you complete a few prerequisite steps before using.
- To add a Google step to your flow, go to the Apps panel in the palette, expand the Google section, and drag the step onto the canvas.
- Connect the step to the previous step in the flow so you have access to the properties and outputs of previous steps when configuring this step's inputs.
- Double-click the step to edit it, and use the Setup tab to configure the inputs. You can use plain text and input variables (or both). See the sections below for detailed information on the inputs for the step.
- On the Endpoint tab, click Add Endpoint.
- Type a Name to reference the endpoint from within the step.
- Paste the webhook URL from your Google Chat space into the Base URL field.
- Click Save.
Post Simple Message (webhook)
Use the Post Simple Message (webhook) step to automatically send a simple text message to a Google Chat space. Map outputs from previous steps to populate the message. To use the Post Simple Message step you need to set up an incoming webhook connector in your Google Chat space, then create an endpoint that uses the unique URL generated when you set up the webhook connector. For more information, see Google’s guide on Using incoming webhooks.
Inputs
Inputs with an asterisk* are required.
Label |
Description |
---|---|
Message* | Content of the message to post to Google Chat in simple text message formatting. |
Post Card Message (webhook)
Use the Post Card Message (webhook) step to automatically send a new message to a Google Chat space using text, constants, and the outputs from previous steps to populate the inputs. To use the Post Card Message step, you need to set up an incoming webhook connector in your Google Chat space, then create an endpoint that uses the unique URL generated when you set up the webhook connector. For more information, see Google’s guide on Using incoming webhooks.
Inputs
Inputs with an asterisk* are required.
Label |
Description |
---|---|
Card Sections* | A valid JSON array representing different sections within the card. Use the template provided, or see the Google Chat API documentation for more information on formatting card messages. |
Title | Title displayed in the card header. |
Subtitle | Short description displayed in the card header. |
Image URL | Image displayed in the card header. Images are displayed as a square thumbnail. |
Prerequisites
Before you can use the Post Text Message and Create Chat Space steps, you must first complete the following configuration settings.
- In your Google Cloud project, enable the Google API.
- Once the API is enabled, create Google API OAuth Credentials.
- You'll need the Client ID and Client Secret to configure Flow Designer, so ensure you save those to an easy-to-find location.
- Gather the scope permissions required for the step you want to use.
- For the Post Text Message step, you'll need the following two scope permissions:
- To find the chat space: https://www.googleapis.com/auth/chat.spaces.readonly
- To post the message to the chat space: https://www.googleapis.com/auth/chat.messages.create
- For the Create Chat Space step, you'll need the following scope permission:
- To create the chat space: https://www.googleapis.com/auth/chat.spaces.create
- For the Post Text Message step, you'll need the following two scope permissions:
Once the Google configuration steps are complete, configure the Flow Designer endpoint.
- In Flow Designer, open the workflow you want to connect to Google.
- Go to the Flow Designer tab.
- Click the name of the canvas you want to create or edit flows for (or Create Flow Canvas if you don't have one yet).
- Open the Components menu in the top right corner and select Endpoints.
- Click Add Endpoint.
- Fill in the following fields:
- Name: give the endpoint a unique name, such as “Google” or “Google API”.
- Base URL: https://chat.googleapis.com
- Trust self-signed certificates: leave the checkbox disabled.
- Endpoint Type: select OAuth 2.0 (Authorization Code)
- Authorization URL: https://accounts.google.com/o/oauth2/auth?access_type=offline
- Access Token URL: https://oauth2.googleapis.com/token
- Client ID: enter the Client ID from the Google OAuth credentials you created.
- Client Secret: enter the Client Secret from the Google OAuth credentials you created.
- Token Prefix: leave this field as Bearer.
- Endpoint Scope: enter the Google API endpoints scope. Separate multiple scopes with a space.
- Click Connect. A Google login page will open in a new browser window or tab.
- Log in using the Google user account you want to use to authenticate your workflow.
Google only provides a refresh token on consent, so to connect to the Google API from different workflows you have two options:
- Create Google OAuth Credentials for each workflow.
- Log in to the endpoint for each workflow with a different Google user account.
- On the Endpoints page in Flow Designer, click Save.
Post Text Message
Use the Post Text Message step to automatically send a simple text message to a Google Chat space. Map outputs from previous steps to populate the message. Before adding the Post Text Message step to your flow, ensure you've completed the configuration prerequisites.
Inputs
Inputs with an asterisk* are required.
Label |
Description |
---|---|
Space | Name or ID of the Google chat space. |
Message | Content of the message to post to the Google Chat in simple text message formatting. |
Thread ID | ID of the Google chat thread where the message will be posted. |
Outputs
Label |
Description |
---|---|
Result |
The result returned to Flow Designer by Google. Available options are:
|
Space ID | Unique ID of the Google chat space. |
Thread ID | ID of the Google Chat thread that can be used to reply to the same thread. |
Message ID | Unique ID of the message. |
Create Chat Space
Use the Create Chat Space step to create a new Google Chat space. Map outputs from previous steps to populate the message. Before adding the Create Chat Space step to your flow, ensure you've completed the configuration prerequisites.
Inputs
Inputs with an asterisk* are required.
Label |
Description |
---|---|
Name | Name of the Google Chat space. Maximum length is 128 characters. Longer values will be truncated. |
Description | Description of the chat space. Maximum length is 150 characters. Longer values will be truncated. |
Guidelines | Rules, expectations, and etiquette for the space. Maximum length is 5000 characters. Longer values will be truncated. |
Allow External Users |
Whether the chat space is available to all members, or restricted to workspace members. Available options are:
|
Outputs
Label |
Description |
---|---|
Result |
The result returned to Flow Designer by Google. Available options are:
|
Space ID | Unique ID of the Google Chat space. |
Name | Name of the Google Chat space. Input values over 128 characters are truncated. |
Allow External Users |
Whether the chat space is available to all members, or restricted to workspace members. Available options are:
|
Description | Brief description of the chat space such as the topic, purpose, or participants. Input values over 150 characters are truncated. |
Guidelines | Rules, expectations, and etiquette for the space. Input values over 5000 characters are truncated. |
Chat Space URL | Direct URL to the Google Chat space. |