Sign inStart your trial

Gmail

Reference

2 triggers and 63 actions for Gmail workflows.

01. Triggers

Start a workflow when something happens in Gmail

Each trigger lists the event it fires on, the data it sends, and a template you can use it in.

Webhook

2 triggers

Real-time push from the source.

Webhook★ Featured

GMAIL_EMAIL_SENT_TRIGGER

Fires whenever you send an email from Gmail. You'll receive details about the message including who it was sent to, the subject line, and when it was sent.

3 config fields12 output fields
Webhook★ Featured

GMAIL_NEW_GMAIL_MESSAGE

Fires when a new email arrives in your Gmail inbox. This happens immediately when the message is received.

4 config fields12 output fields
02. Operations

Act on Gmail from a workflow

Operations are the actions a workflow can take in Gmail, grouped by category. Each lists its method, parameters, and a template you can drop it into.

Aliases

2 operations

Manage email aliases that represent different send-as identities for your Gmail account. Use these operations to create, view, and update the addresses from which you can send emails in automated workflows.

Action

List send-as aliases

GMAIL_LIST_SEND_AS

Retrieves all available email addresses and aliases you can send from in your Gmail account, including your primary address and any custom 'from' addresses you've configured.

1 input
Action

Patch send-as alias

GMAIL_PATCH_SEND_AS

Update an existing send-as email alias in Gmail by modifying its display name, reply-to address, signature, or other settings without creating a new one.

8 input

Attachments

1 operation

Retrieve file attachments from Gmail messages during workflow automation. This enables you to access and process documents, images, and other files included in emails without downloading them manually.

Action

Get Gmail attachment

GMAIL_GET_ATTACHMENT

Download and retrieve a specific attachment from a Gmail message so you can access files sent to you by clients, customers, or collaborators. The attachment is returned as a downloadable file that you can immediately use or store.

4 input

Contacts

3 operations

Access and search your Gmail contacts and People directory to enrich workflows with recipient information. Use these operations to look up contact details or integrate contact data into your automation processes.

Action★ Featured

Search People

GMAIL_SEARCH_PEOPLE

Find contacts in your Gmail address book by searching across names, emails, phone numbers, and organizations. This helps you quickly locate specific people you've saved without manually browsing your entire contact list.

4 input
Action

Get contacts

GMAIL_GET_CONTACTS

Retrieve your saved contacts and other connections from your Google account to access their names, email addresses, and other details. Use this to programmatically access your contact list for automation and integration purposes.

4 input
Action

Get People

GMAIL_GET_PEOPLE

Retrieves contact information from your Gmail account, including details about specific people or your other contacts list. This helps you access and manage your contact data programmatically for business purposes.

7 input

Drafts

5 operations

Create, manage, and send email drafts programmatically as part of your automation workflow. These operations let you compose messages, save them for later, modify content, and ultimately send them when ready.

Action★ Featured

Create email draft

GMAIL_CREATE_EMAIL_DRAFT

Creates a Gmail email draft that you can review and edit before sending, allowing you to compose messages with recipients, subject, body content, and attachments. This gives you time to refine your message and send it on your schedule.

10 input
Action

Delete Draft

GMAIL_DELETE_DRAFT

Permanently removes a draft email from Gmail, freeing up space and ensuring unwanted messages don't get accidentally sent later.

2 input
Action

Get Draft

GMAIL_GET_DRAFT

Retrieve the full content and details of a specific Gmail draft to review or verify it before sending. This helps you check formatting, recipients, and message body without opening your email client.

3 input
Action

List Drafts

GMAIL_LIST_DRAFTS

Retrieve all email drafts from your Gmail inbox to view, organize, or recover unsent messages. Use this to audit draft content, find incomplete emails, or build automated workflows around your drafting process.

4 input
Action

Send Draft

GMAIL_SEND_DRAFT

Sends a pre-written draft email to its existing recipients without any modifications. Use this when you've already prepared and reviewed an email draft and are ready to deliver it immediately.

2 input

Filters

4 operations

Define and manage Gmail filters that automatically organize, label, or process incoming emails based on rules. Use these operations to set up automated email handling in your workflows without manual sorting.

Action

Create Gmail filter

GMAIL_CREATE_FILTER

Automatically organize and manage your incoming emails by creating filters that sort messages based on criteria like sender, subject, or keywords, then apply actions such as labeling, archiving, or deleting them.

3 input
Action

Delete Gmail filter

GMAIL_DELETE_FILTER

Permanently removes an email filtering rule from your Gmail account so emails matching that filter's criteria will no longer be automatically organized or processed.

2 input
Action

Get Gmail filter

GMAIL_GET_FILTER

Retrieve the details of a specific Gmail filter to view its criteria and actions. This helps you understand how messages are being automatically organized or processed in your inbox.

2 input
Action

List Gmail filters

GMAIL_LIST_FILTERS

Retrieve all email filter rules configured in your Gmail account to review existing automation and prevent duplicate filter creation. Use this before setting up new filters or conducting a security check of your email management setup.

1 input

Forwarding

2 operations

Configure email forwarding rules and auto-forwarding settings for your Gmail account. These operations allow you to redirect emails automatically and manage which addresses receive your incoming mail.

Action

Get Auto-Forwarding Settings

GMAIL_GET_AUTO_FORWARDING

Retrieve your Gmail account's auto-forwarding configuration, including whether it's enabled and where emails are being sent. This helps you verify your email routing setup and ensure messages reach the right destinations.

1 input
Action

List forwarding addresses

GMAIL_LIST_FORWARDING_ADDRESSES

Retrieve all email forwarding addresses configured on a Gmail account to see which addresses can receive forwarded messages. This helps you manage where your emails are being sent and maintain visibility over your email routing setup.

1 input

History

1 operation

Retrieve the history of changes to your Gmail account, including message additions, deletions, and label modifications. This helps you track and audit email activity for compliance or debugging purposes in your automation.

Action

List Gmail history

GMAIL_LIST_HISTORY

Retrieve incremental changes to your Gmail mailbox since a specific point in time, allowing you to stay synchronized with new messages, deletions, and label changes without processing your entire inbox repeatedly.

6 input

Labels

8 operations

Create, modify, and manage labels to organize and categorize emails in your Gmail account. These operations enable you to automate email classification, update label properties, and apply labels to messages and threads.

Action★ Featured

Create label

GMAIL_CREATE_LABEL

Organize your Gmail inbox by creating custom labels to categorize and manage emails effectively. This operation generates a unique label that can be applied to messages and threads for better email organization.

6 input
Action★ Featured

Modify email labels

GMAIL_ADD_LABEL_TO_EMAIL

Organize and categorize your emails by applying Gmail labels to specific messages, helping you keep your inbox structured and easy to search. This is useful for sorting incoming mail into projects, clients, or priority levels.

4 input
Action

Delete label from account (permanent)

GMAIL_DELETE_LABEL

Permanently removes a custom Gmail label from your account, deleting it from all associated messages. This is useful for cleaning up outdated or unused organizational categories.

2 input
Action

Get label details

GMAIL_GET_LABEL

Retrieve detailed information about a specific Gmail label including its name, visibility settings, and message counts. This helps you understand how your emails are organized and manage your labeling system.

2 input
Action

List Gmail labels

GMAIL_LIST_LABELS

Retrieves all labels in your Gmail account and returns their internal IDs needed to organize, filter, and manage emails programmatically. Use this to get the exact label identifiers required by other Gmail operations.

2 input
Action

Modify thread labels

GMAIL_MODIFY_THREAD_LABELS

Organize your Gmail threads by adding or removing labels in bulk, allowing you to quickly categorize entire conversations for better email management and retrieval.

4 input
Action

Patch Label

GMAIL_PATCH_LABEL

Update the name, color, or other properties of a custom Gmail label you've created to keep your email organization system current and aligned with your business needs.

6 input
Action

Remove label (Deprecated)

GMAIL_REMOVE_LABEL

Permanently deletes a custom Gmail label from your account, helping you clean up and reorganize your email management system.

2 input

Messages

17 operations

Send, retrieve, modify, and delete individual emails and threads in Gmail. These core operations form the foundation of email automation, allowing you to manage message lifecycle from creation through archival.

Action★ Featured

Batch delete Gmail messages

GMAIL_BATCH_DELETE_MESSAGES

Permanently remove multiple Gmail messages at once, completely deleting them without sending to Trash. Use this when you need to enforce email retention policies or maintain a clean inbox at scale.

2 input
Action★ Featured

Fetch emails

GMAIL_FETCH_EMAILS

Retrieve a list of emails from your Gmail inbox with support for filtering and pagination to find specific messages or manage large volumes of email data efficiently.

9 input
Action★ Featured

Reply to email thread

GMAIL_REPLY_TO_THREAD

Send a reply within an existing Gmail conversation thread to continue an ongoing discussion with clients or contacts. This keeps related messages organized together rather than starting a new email chain.

9 input
Action★ Featured

Send Email

GMAIL_SEND_EMAIL

Send emails directly from your Gmail account with support for recipients, attachments, and HTML formatting. This is ideal for automating customer communications, notifications, and follow-ups without leaving your workflow.

10 input
Action

Batch modify Gmail messages

GMAIL_BATCH_MODIFY_MESSAGES

Update labels and status across multiple Gmail messages simultaneously, allowing you to organize, archive, or categorize dozens of emails in a single action.

4 input
Action

Create Prompt Post

GMAIL_CREATE_PROMPT_POST

Send a single prompt to the Sanity Content Agent and receive an immediate response without maintaining conversation history, perfect for one-off requests that don't require context from previous interactions.

5 input
Action

Delete message

GMAIL_DELETE_MESSAGE

Permanently removes a specific email message from your Gmail mailbox, helping you clean up unwanted or outdated messages.

2 input
Action

Delete thread

GMAIL_DELETE_THREAD

Permanently remove a specific email thread and all its messages from your Gmail account. This action is irreversible, so use it only when you're certain you no longer need the conversation.

2 input
Action

Fetch message by message ID

GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID

Retrieves the full content of a specific email message by its ID, allowing you to access the complete message details including body, attachments, and metadata. This is essential for reading individual emails when you know their ID or need to process specific messages for business workflows.

3 input
Action

Fetch Message by Thread ID

GMAIL_FETCH_MESSAGE_BY_THREAD_ID

Retrieves all messages from a specific Gmail conversation thread, allowing you to access the full context and history of an email exchange with a customer or collaborator.

3 input
Action

Forward email message

GMAIL_FORWARD_MESSAGE

Forward an existing Gmail message to new recipients while keeping the original content and attachments intact, helping you quickly share important emails with team members or clients.

6 input
Action

Import message

GMAIL_IMPORT_MESSAGE

Adds an existing email message directly into your Gmail mailbox, allowing you to import messages from external sources or archives without going through standard email delivery. This is useful when you need to restore, organize, or consolidate emails that didn't arrive through normal channels.

6 input
Action

Insert message into mailbox

GMAIL_INSERT_MESSAGE

Adds an email directly to your mailbox without sending it, allowing you to archive important messages, create drafts, or restore emails from backups.

4 input
Action

List Gmail messages (Deprecated)

GMAIL_LIST_MESSAGES

Retrieves a list of email messages from your mailbox with optional filtering by labels or search criteria to help you find and organize specific emails.

6 input
Action

List threads

GMAIL_LIST_THREADS

Retrieve a list of email threads from your Gmail inbox with optional filtering and pagination to organize and find conversations. This helps you bulk-process, search, or analyze your emails programmatically without manually opening Gmail.

5 input
Action

Move to Trash

GMAIL_MOVE_TO_TRASH

Safely removes an email message to your trash folder, allowing you to recover it later if needed without permanently deleting it. Use this when you want to clean up your inbox while maintaining the option to restore important messages.

2 input
Action

Trash thread

GMAIL_MOVE_THREAD_TO_TRASH

Moves an entire email conversation and all its messages to trash, allowing you to clean up your inbox and organize communications. This helps you remove old threads without permanently deleting them.

2 input

Profile

1 operation

Retrieve your Gmail account profile information including your email address and basic account details. This operation provides foundational account metadata for use in workflow initialization and validation.

Action

Get Profile

GMAIL_GET_PROFILE

Retrieves essential Gmail account information including the email address, total message and conversation counts, and a history ID for tracking changes. This helps you verify mailbox connectivity and get a snapshot of account activity.

1 input

Security

3 operations

Access security configurations including S/MIME certificates and Client-Side Encryption identities and key pairs. Use these operations to manage encrypted communication and verify secure email setup in your automation.

Action

List CSE identities

GMAIL_LIST_CSE_IDENTITIES

Retrieve all client-side encrypted email identities and their associated key pair configurations for your Gmail account. Use this to manage and audit your encrypted email setup.

3 input
Action

List CSE key pairs

GMAIL_LIST_CSE_KEYPAIRS

Retrieve all client-side encryption key pairs configured for your Gmail account, including their public keys and current status. This helps you manage encrypted communication settings and verify which encryption keys are active for your email security.

3 input
Action

List S/MIME configs

GMAIL_LIST_SMIME_INFO

Retrieve all S/MIME certificate configurations for a specific email address so you can verify which security certificates are active and available for encrypted email sending.

2 input

Settings

3 operations

Configure Gmail account settings such as language preferences, vacation responders, and IMAP/POP protocols. These operations let you automate account configuration and enable or disable features programmatically.

Action

Get IMAP Settings

GMAIL_SETTINGS_GET_IMAP

Retrieve your Gmail account's IMAP configuration details to understand how your email client can access and manage your messages. This helps you verify your email setup is correct and troubleshoot connection issues.

1 input
Action

Get Language Settings

GMAIL_GET_LANGUAGE_SETTINGS

Retrieve the language preference currently set for a Gmail account to understand how the interface is displayed for that user.

1 input
Action

Get Vacation Settings

GMAIL_GET_VACATION_SETTINGS

Retrieve your Gmail vacation responder settings to check if out-of-office auto-replies are enabled and view their configuration. This helps you verify your away messages are properly set up before taking time off.

1 input

Communication

13 operations
Action

Get POP settings

GMAIL_SETTINGS_GET_POP

Tool to retrieve POP settings for a Gmail account.

1 input
Action

Get send-as alias

GMAIL_SETTINGS_SEND_AS_GET

Tool to retrieve a specific send-as alias configuration for a Gmail user.

2 input
Action

Stop watch notifications

GMAIL_STOP_WATCH

Tool to stop receiving push notifications for a Gmail mailbox.

1 input
Action

Untrash Message

GMAIL_UNTRASH_MESSAGE

Tool to remove a message from trash in Gmail.

2 input
Action

Untrash thread

GMAIL_UNTRASH_THREAD

Tool to remove a thread from trash in Gmail.

2 input
Action

Update draft

GMAIL_UPDATE_DRAFT

Updates (replaces) an existing Gmail draft's content in-place by draft ID.

11 input
Action

Update IMAP settings

GMAIL_UPDATE_IMAP_SETTINGS

Tool to update IMAP settings for a Gmail account.

5 input
Action

Update Label

GMAIL_UPDATE_LABEL

Tool to update the properties of an existing Gmail label.

6 input
Action

Update Language Settings

GMAIL_UPDATE_LANGUAGE_SETTINGS

Tool to update the language settings for a Gmail user.

2 input
Action

Update POP settings

GMAIL_UPDATE_POP_SETTINGS

Tool to update POP settings for a Gmail account.

3 input
Action

Update send-as alias

GMAIL_UPDATE_SEND_AS

Tool to update a send-as alias for a Gmail user.

8 input
Action

Update User Attributes Values

GMAIL_UPDATE_USER_ATTRIBUTES_VALUES

Update user attribute values for a resource.

4 input
Action

Update Vacation Settings

GMAIL_UPDATE_VACATION_SETTINGS

Tool to update vacation responder settings for a Gmail user.

9 input
What now

Use Gmail in a workflow

Combine these triggers and actions with the tools you already run.