Workflows
Blocks
Integrations
Gmail

Gmail Action Block

The Gmail Action Block lets your workflow work inside your Gmail mailbox — send emails, read and search messages, reply in the same conversation, manage labels, create drafts, and forward mail.

Email Automation: Combine this block with the Gmail Trigger to build a full email agent — the trigger fires when a new email arrives, and this block reads, replies, labels, or forwards it.

Key Features

  • 13 Actions: Send, read, search, reply, forward, drafts, labels, read/unread state, threads, and attachments
  • Auto-Threading Replies: The Reply action keeps your response inside the original conversation
  • Powerful Search: Filter by sender, recipient, subject, date range, and attachments — up to 500 results per call
  • Save Any Value: Map parts of the response (Subject, From, Body, Message Id, and more) into workflow variables
  • Variable Support: Every field accepts {{variables}} from earlier blocks

Available Actions

ActionWhat it does
Send EmailSend a new email (To, CC, BCC, subject, body, optional HTML)
Read EmailFetch one message by its Message ID
Search EmailsFind messages using filters (see below)
ReplyReply to a message — automatically threads into the original conversation
Move to TrashMove a message to the Trash folder
Create DraftSave an email as a draft without sending it
List LabelsGet all labels in the mailbox
Apply/Remove LabelsAdd or remove label IDs on a message
Mark as ReadRemove the unread state from a message
Mark as UnreadMark a message as unread
Get ThreadFetch a full conversation by its Thread ID
Forward EmailForward an existing message to new recipients
Send with AttachmentSend a new email with one or more attachment URLs

Reply threads automatically: give the Reply action the Message ID of the email you are answering (for example from the Gmail Trigger or a Search result) and Gmail places your reply in the same conversation.


Search Filters

The Search Emails action supports these filters:

FilterDescription
FromOnly messages from this sender
ToOnly messages sent to this address
Subject ContainsText that must appear in the subject
After / Before dateDate range in YYYY/MM/DD format
Has AttachmentOnly messages with attachments
Include Spam & TrashAlso search Spam and Trash folders
Max Results1 to 500 messages per call (default 100)
Page TokenContinue a previous search — feed the Next Page Token output back in

Connecting your Google account

  1. Add the Gmail block to your workflow and open its settings.
  2. Click the connect button and choose Continue with Google.
  3. Sign in and approve the requested permission (gmail.modify — read, send, and organize mail).
  4. The credential is saved and named after your Google account email. Select it in the block's dropdown.
⚠️

The Gmail block needs the gmail.modify scope. If you skip a permission on the Google consent screen, actions like Reply or Apply Label will fail — reconnect the account and approve all requested permissions.


Saving output to variables

Use Response Mapping in the block settings to store parts of the result in variables. Pick a value to extract and the variable to save it in.

Common extractable values:

ValueDescription
Subject, From, To, Cc, Bcc, DateHeader fields of the message
BodyThe message body text
SnippetShort preview text of the message
Message Id / IdThe Gmail message id — use it for Reply, Trash, Labels, and Mark Read/Unread
Thread Id / ThreadThe conversation id — use it with Get Thread
MessagesThe list of messages returned by Search or Get Thread
Labels / Label Id / Label NameLabel data from List Labels
Draft IdThe id of a draft created by Create Draft
Next Page TokenToken to fetch the next page of search results
Full DataThe complete raw response

Example: Support auto-reply

  1. Gmail Trigger — fires when a new email arrives in the support inbox.
  2. LLM Agent — drafts an answer from the email body.
  3. Gmail (Reply) — sends the answer using the trigger's Message ID, so it lands in the same thread.
  4. Gmail (Apply/Remove Labels) — applies an "answered" label to the original message.

Related

Indite Documentation v1.7.1
PrivacyTermsSupport