Google Chat Trigger
Google Chat Trigger starts a flow every time someone writes a new message in Google Chat: in a space, in a group chat or in a direct message to the connected account. The flow receives the message text, who sent it, the space and the thread, everything needed to answer in the same place.
NappAI checks Google Chat about every minute and runs the flow once per new message, oldest first. You don’t need to create a Chat app or set anything up in Google: the credential and activating the trigger are enough.
When to use it
- Build an assistant that answers the team’s questions in Google Chat from the company documentation.
- Open a ticket in your support tool whenever someone writes in the incidents space.
- Have an agent answer only when it is @mentioned in a busy space.
- Log in a spreadsheet the requests that arrive by direct message.
Configuration
You need a Google Chat credential, connected by signing in with your Google account. The messages watched are those that account can see. See Credentials and, if you use your own Google Cloud project, Connecting Google services.
| Field | What it does |
|---|---|
| Credential (required) | The Google Chat credential of the account that receives the messages. |
| Spaces | The spaces, group chats or direct messages to watch. Once the credential is chosen, the list shows your spaces, most active first. Leave it empty to watch all of them. |
| Ignore My Own Messages | Messages sent by the account itself do not start the flow. On by default. Keep it on if the flow answers in Google Chat; otherwise each answer would start it again. |
| Only When Mentioned | In spaces and group chats, only messages that @mention the account start the flow. Direct messages always do. Off by default. |
| Max Messages per Check (advanced) | The most messages handled in one check; each one is a run of the flow. The rest wait for the next check. Default 20. |
| Check Every (seconds) (advanced) | How often Google Chat is checked. Between 60 seconds and one day. Default 60. |
| Data | Test field. Lets you try the flow with a sample message without waiting for someone to write. Leave it empty in normal use. |
Activate the trigger
The flow only receives messages while the trigger is active:
- Save the flow and publish a version. See Versions and publishing.
- In the node’s settings panel click Activate, or open New Items Triggers and click Activate next to Google Chat Trigger. The status becomes Listening.
Only messages written after activating arrive. If you change the watched spaces, the status shows Out of sync: click Update to apply the change. From the same panel you can Deactivate the trigger.
If activating shows the warning that your own messages cannot be told apart, edit the Google Chat credential and sign in with Google again: the credential now also asks for your basic profile, which is what lets it recognise the account’s messages.
Result
The Data output carries the new message. Its text is the message text, so you can connect it straight to an agent. It also has:
message_id: the message id.text: the text.space,space_nameandspace_type: the space (its id, its name, and whether it is a space, a group chat or a direct message).thread_nameandis_thread_reply: the message’s thread and whether it is a reply inside it.sender_idandsender_type: who sent it and whether it is a person or an app.sender_namecarries the name when Google provides it; with personal credentials it is usually empty for people.createTime: when it was sent.mentions: the people mentioned.attachments: the message’s files, with name, type and download link.
The flow’s conversation is the space’s: an agent connected to the trigger remembers what was said in each space or direct message separately.
Example
An assistant that answers in the support space.
- Add Google Chat Trigger, choose the credential and, in Spaces, the support space.
- Connect its output to an Agent with the company documentation as a tool.
- Add Google Chat Messages with the
Reply to Messageoperation, Thread ID ={thread_name}and Message Text = the agent’s answer. - Publish the flow and click Activate.
- Write a question in the support space: the answer arrives in its thread within a minute.
Good practices
- Use a Google account of its own for the assistant (for example a support one) and invite it to the spaces where it must answer. That way its answers stand apart from people’s.
- In busy spaces, turn on Only When Mentioned so the assistant speaks only when called.
- Try the flow with the Data field, or by writing yourself a message after activating it.
Related components
- Google Chat Messages: answer, send and read messages.
- Google Chat Spaces: create spaces and manage their members.