Skip to main content
Gmail actions let an agent work with a mailbox directly in a flow. An agent can send and reply to messages, manage drafts and threads, apply and remove labels, and pass the results to later steps.

Supported actions

Prerequisites

Set up a Google OAuth credential by following the Google Cloud Console OAuth setup guide, store it in Credential Management, then select it on every Gmail action. Gmail actions also support end user authentication, so a step can act on each user’s own mailbox.

How to use these actions

  • Map text inputs from earlier steps. Inputs such as To, Subject, and Body accept a value mapped from a previous step. Max Results and the Is HTML and Include Spam Trash toggles take fixed values.
  • Recipient fields accept multiple addresses. To, Cc, and Bcc accept multiple comma separated addresses.
  • List actions use Gmail search syntax. The Query input on the Get All actions uses Gmail search syntax such as is:unread or from:user@example.com.
  • Labels are comma separated. Label IDs is a comma separated list.
  • Send HTML bodies. Set Is HTML on to send an HTML body.

Actions

Message

Gmail Message Send

Sends a new message.

Gmail Message Reply

Replies to an existing message.

Gmail Message Get

Retrieves a message by ID.

Gmail Message Get All

Lists messages.

Gmail Message Delete

Deletes a message.

Gmail Message Mark As Read

Marks a message as read.

Gmail Message Mark As Unread

Marks a message as unread.

Gmail Message Add Labels

Adds labels to a message.

Gmail Message Remove Labels

Removes labels from a message.

Draft

Gmail Draft Create

Creates a draft message.

Gmail Draft Get

Retrieves a draft by ID.

Gmail Draft Get All

Lists drafts.

Gmail Draft Delete

Deletes a draft.

Thread

Gmail Thread Reply

Replies to a thread.

Gmail Thread Get

Retrieves a thread by ID.

Gmail Thread Get All

Lists threads.

Gmail Thread Delete

Deletes a thread.

Gmail Thread Trash

Moves a thread to trash.

Gmail Thread Untrash

Restores a thread from trash.

Gmail Thread Add Labels

Adds labels to a thread.

Gmail Thread Remove Labels

Removes labels from a thread.

Label

Gmail Label Create

Creates a label.

Gmail Label Get

Retrieves a label by ID.

Gmail Label Get All

Lists labels. This action takes no inputs beyond the credential.

Gmail Label Delete

Deletes a label.

Example

An agent that triages unread mail and replies on behalf of the user:
1

Find unread messages

A Gmail Message Get All action sets Query to is:unread and Max Results to a fixed value so the flow reads only the latest unread messages.
2

Draft the reply

A model step reads the message body and writes a response, then a Gmail Message Reply action maps Message ID to the message from the previous step and Body to the generated reply.
3

Mark and file

A Gmail Message Mark As Read action clears the unread flag, and a Gmail Message Add Labels action applies a follow up label by passing its ID into Label IDs.

Troubleshooting

The Message ID or Thread ID does not exist in the connected mailbox. Confirm the ID with a Get All action and that the credential is for the correct account.
A label passed to Label IDs must be an existing label ID, not a label name. Use Gmail Label Get All to look up label IDs first, or create the label with Gmail Label Create.
The Google OAuth credential expired or was revoked. Reconnect the credential and confirm the required Gmail scopes were granted during consent.
Set Is HTML on when the Body contains HTML markup. With the toggle off, the body is sent as plain text.
For issues common to every vendor, see the Actions overview.