Skip to main content
Connect your Idun agent to Google Chat so users can interact with it by @mentioning the bot in spaces and direct messages.

Prerequisites

  • A running Idun agent (engine)
  • A Google Workspace account with access to Google Chat
  • A Google Cloud project (free to create, no billing required for Chat API config)
  • Your engine must be publicly reachable (use ngrok for local development)

Setup

1

Open the integrations catalog

Navigate to Integrations. The channel catalog shows available channels including Google Chat.
2

Create the Google Chat integration

Click + on Google Chat and fill in the credentials.
FieldValue
service_account_credentials_jsonFull JSON key file content from your GCP service account
project_numberGCP project number (found on the Cloud Console dashboard)
3

Assign to an agent

After saving, open the agent you want to connect and select the Google Chat integration from the Integrations field.

How it works

  1. User @mentions the bot in a space or sends a direct message
  2. Google Chat POSTs the interaction event to your engine’s webhook
  3. Engine verifies the JWT bearer token (signed by chat@system.gserviceaccount.com) using the project number as audience
  4. Engine extracts the message text (stripping the @mention prefix via argumentText)
  5. Engine invokes the agent with the cleaned text
  6. Engine sends the agent’s reply back via the Google Chat API (spaces.messages.create)
Session tracking: The Google Chat user resource name (users/123456) is used as the session ID, so conversation context is maintained per user. Bot messages ignored: The handler skips messages from senders with type BOT to avoid infinite loops. @mention stripping: Google Chat provides an argumentText field that contains the message text without the @mention. The engine uses this so your agent receives clean input (e.g. “do stuff for me” instead of “@BotName do stuff for me”).
Last modified on March 31, 2026