Skip to main content

Documentation Index

Fetch the complete documentation index at: https://explore.airia.com/llms.txt

Use this file to discover all available pages before exploring further.

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

GroupActions
MessageSend, Reply, Get, Get All, Delete, Mark As Read, Mark As Unread, Add Labels, Remove Labels
DraftCreate, Get, Get All, Delete
ThreadReply, Get, Get All, Delete, Trash, Untrash, Add Labels, Remove Labels
LabelCreate, Get, Get All, Delete

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.
InputRequiredDescription
ToYesRecipient addresses, comma separated for multiple recipients.
SubjectYesThe subject line of the message.
BodyYesThe body content of the message.
CcNoCarbon copy addresses, comma separated.
BccNoBlind carbon copy addresses, comma separated.
Is HTMLNoToggle. Set on to send the body as HTML. Defaults to off.

Gmail Message Reply

Replies to an existing message.
InputRequiredDescription
Message IDYesThe message to reply to.
BodyYesThe reply content.
Is HTMLNoToggle. Set on to send the reply as HTML.

Gmail Message Get

Retrieves a message by ID.
InputRequiredDescription
Message IDYesThe message to retrieve.

Gmail Message Get All

Lists messages.
InputRequiredDescription
Max ResultsNoMaximum number of messages to return, from 1 to 500. Defaults to 10.
QueryNoA Gmail search query, such as is:unread or from:user@example.com.
Label IDsNoComma separated list of labels to filter by.
Include Spam TrashNoToggle. Set on to include messages from spam and trash. Defaults to off.

Gmail Message Delete

Deletes a message.
InputRequiredDescription
Message IDYesThe message to delete.

Gmail Message Mark As Read

Marks a message as read.
InputRequiredDescription
Message IDYesThe message to mark as read.

Gmail Message Mark As Unread

Marks a message as unread.
InputRequiredDescription
Message IDYesThe message to mark as unread.

Gmail Message Add Labels

Adds labels to a message.
InputRequiredDescription
Message IDYesThe message to update.
Label IDsYesComma separated labels to add.

Gmail Message Remove Labels

Removes labels from a message.
InputRequiredDescription
Message IDYesThe message to update.
Label IDsYesComma separated labels to remove.

Draft

Gmail Draft Create

Creates a draft message.
InputRequiredDescription
ToYesRecipient addresses, comma separated for multiple recipients.
SubjectYesThe subject line of the draft.
BodyYesThe body content of the draft.
CcNoCarbon copy addresses, comma separated.
BccNoBlind carbon copy addresses, comma separated.
Is HTMLNoToggle. Set on to use an HTML body. Defaults to off.

Gmail Draft Get

Retrieves a draft by ID.
InputRequiredDescription
Draft IDYesThe draft to retrieve.

Gmail Draft Get All

Lists drafts.
InputRequiredDescription
Max ResultsNoMaximum number of drafts to return, from 1 to 500. Defaults to 10.

Gmail Draft Delete

Deletes a draft.
InputRequiredDescription
Draft IDYesThe draft to delete.

Thread

Gmail Thread Reply

Replies to a thread.
InputRequiredDescription
Thread IDYesThe thread to reply to.
BodyYesThe reply content.
Is HTMLNoToggle. Set on to send the reply as HTML.

Gmail Thread Get

Retrieves a thread by ID.
InputRequiredDescription
Thread IDYesThe thread to retrieve.

Gmail Thread Get All

Lists threads.
InputRequiredDescription
Max ResultsNoMaximum number of threads to return, from 1 to 500. Defaults to 10.
QueryNoA Gmail search query, such as is:unread or from:user@example.com.
Label IDsNoComma separated list of labels to filter by.
Include Spam TrashNoToggle. Set on to include threads from spam and trash. Defaults to off.

Gmail Thread Delete

Deletes a thread.
InputRequiredDescription
Thread IDYesThe thread to delete.

Gmail Thread Trash

Moves a thread to trash.
InputRequiredDescription
Thread IDYesThe thread to move to trash.

Gmail Thread Untrash

Restores a thread from trash.
InputRequiredDescription
Thread IDYesThe thread to restore from trash.

Gmail Thread Add Labels

Adds labels to a thread.
InputRequiredDescription
Thread IDYesThe thread to update.
Label IDsYesComma separated labels to add.

Gmail Thread Remove Labels

Removes labels from a thread.
InputRequiredDescription
Thread IDYesThe thread to update.
Label IDsYesComma separated labels to remove.

Label

Gmail Label Create

Creates a label.
InputRequiredDescription
NameYesThe name of the label.
Label List VisibilityNoVisibility of the label in the label list, one of labelShow, labelShowIfUnread, or labelHide.
Message List VisibilityNoVisibility of messages with the label in the message list, one of show or hide.

Gmail Label Get

Retrieves a label by ID.
InputRequiredDescription
Label IDYesThe label to retrieve.

Gmail Label Get All

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

Gmail Label Delete

Deletes a label.
InputRequiredDescription
Label IDYesThe label to delete.

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.