Skip to main content
Google Chat The Google Chat app turns a Google Chat bot into the user-facing interface of a Prisme.ai Agent Factory agent. Unlike most connectors, the integration is reverse-direction: Google Chat is the caller and Prisme.ai is the server. Each tenant workspace installs the app, opens its configuration app to pick the agent and paste its own Google service account JSON, then pastes the generated HTTPS endpoint URL into the Google Chat app configuration. Incoming user messages are forwarded to the selected agent; the reply is posted back into the same Google Chat thread, and each thread is mapped to its own agent conversation so follow-up questions keep their context.

1:1 chats and spaces

Receives direct messages and ADDED_TO_SPACE events, with configurable greeting and fallback texts.

Per-thread context

Each Google Chat thread is mapped to one Agent Factory conversation, so the agent keeps the thread history server-side.

Async replies

Optionally answers Google Chat immediately and posts the final agent answer back to the thread asynchronously through the Google Chat REST API.

Prerequisites

  • A Google Workspace account with admin-level access to publish a Chat app for at least one user (a regular Gmail account cannot host a Chat app).
  • A Google Cloud project with the Google Chat API enabled at console.cloud.google.com/apis/library/chat.googleapis.com.
  • A Google service account in the same project, with a JSON key downloaded. No IAM role is required; the OAuth scope https://www.googleapis.com/auth/chat.bot is what authorizes outbound calls to the Chat REST API. The full service account JSON (including client_email, private_key, private_key_id) is what you paste in the configuration app.
  • An Agent Factory agent that the bot will query and that you can see (one you own, one shared with you, or a published one). You do not create an API key yourself: the configuration app creates one for the selected agent.

Installation

  1. Go to Apps in the workspace that will host the bot.
  2. Search for Google Chat and install it.
  3. Open the app instance. The onInstall flow generates the endpoint token and the Google Chat endpoint URL, provisions the workspace secrets the connector needs, and fills the read-only ⚙️ Configuration & help field with a link to the configuration app.

Configure the connector

All settings are managed in the configuration app, which writes them to the workspace secrets for you. Do not edit those secrets by hand.
The configuration app is displayed in French. The steps below quote its labels as they appear on screen.
1

Open the configuration app

Click the link in the ⚙️ Configuration & help field of the app instance. The app opens on its Configuration tab; the Aide tab holds a short setup guide.
2

Pick the agent

In the Agent card, search for and select the Agent Factory agent that will answer in Google Chat.
3

Paste the service account JSON

In the Compte de service Google card, paste the full service account JSON exported from Google Cloud Console (must contain client_email, private_key, private_key_id).
4

Adjust the options (optional)

Expand Avancé to change the async mode, the message texts, the Google Chat API base URL or the OAuth scope (see Configuration).
5

Save

Click Enregistrer. On the first save, or when you switch to another agent, the app creates an Agent Factory API key named Google Chat connector for the selected agent, with the agents:read permission and a one-year expiry, and stores it in the googleChatAgentApiKey workspace secret. When you switch agents, it also tries to revoke the key it created for the previous agent. The app confirms with Configuration enregistrée.
6

Copy the endpoint URL

Copy the URL shown in the URL endpoint Google Chat card. You paste it into Google Chat in the next section.

Wire the Google Chat side

1

Open the Chat API Configuration

Open Google Cloud Console → Google Chat API → Configuration. Fill the app name, avatar URL and description.
2

Pick the trigger surfaces

Under Functionality, enable Receive 1:1 messages and Join spaces and group conversations.
3

Paste the endpoint URL

Under Connection settings, select HTTP endpoint URL and paste the endpoint URL copied from the configuration app (it embeds the workspace, the app instance slug and the endpoint token). Set Authentication Audience to the same URL.
4

Restrict the visibility

Under Visibility, choose Make this Chat app available to specific people and groups in <your-domain> and add the test email addresses. Save.
5

Test the bot

Open chat.google.com, start a new chat, search for the app under Internal apps and send a message. Verify that the agent reply lands in the same thread. If you set an acknowledgement text, it appears first.

Configuration

The app instance itself shows a single field, ⚙️ Configuration & help, which links to the configuration app. The connector settings below are stored in the googleChatSettings workspace secret and edited from the configuration app.
The endpoint token and the endpoint URL are generated on install and kept stable across reinstalls; do not edit them by hand. To rotate the service account JSON, paste the new JSON in the configuration app and click Enregistrer.

How it works

  1. Google Chat sends an interaction event to the configured HTTP endpoint URL. Both the classic Chat app event format and the Google Workspace add-on format are accepted, and the reply is wrapped in the matching envelope. The connector validates the query-string token against the configured endpoint token and answers mismatches with Unauthorized Google Chat request..
  2. For MESSAGE events, the incoming payload is normalized into a compact internal shape (chatEvent) covering the text, the space name, the thread and the sender.
  3. In async mode (default), the connector emits a GoogleChat.message.received event and returns the acknowledgement text, or an empty response when no acknowledgement text is set. The downstream onGoogleChatMessage handler:
    • calls askPrismeAgent, which sends the message to the selected agent through the Agents app and reuses the Agent Factory conversation already mapped to this Google Chat thread,
    • posts the final reply back to the same Google Chat thread through the Chat REST API (sendGoogleChatMessage), using a token minted from the service account JSON (getGoogleChatAccessToken),
    • emits GoogleChat.reply.sent or GoogleChat.reply.failed for observability.
  4. In synchronous mode (async replies disabled), the agent call happens inline and the answer is returned in the initial HTTP response.
If the agent needs the user to connect one of its tools first (for example an OAuth connector), the reply contains a link the user opens to connect; they then ask again in the same thread.

Error handling

Common issues

Bot does not appear in chat.google.com: Verify the visibility section of the Google Chat app configuration lists your email (or a group you belong to), and that you searched the Internal apps tab rather than the public Marketplace. Async reply never arrives: Filter the workspace events on type:GoogleChat.*. A GoogleChat.reply.failed event carries the reason: the service account token could not be minted, or the Chat REST API rejected the outbound request. Replies arrive in a new thread instead of the original one: The connector posts with messageReplyOption=REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD, so Google Chat opens a new thread when the original thread cannot be resolved (for example, when the bot is added to a brand-new space).

External resources

Google Chat API

Official Google Chat REST API reference.