Skip to main content
MindStudio
Pricing
Blog About
My Workspace
Google Suite

Update Gmail Labels

The Update Gmail Labels block modifies the labels applied to Gmail messages, either adding or removing them based on your input.

Add or remove labels on Gmail messages

The Update Gmail Labels block modifies the labels applied to Gmail messages, either adding or removing them based on your input. You can target messages in two ways: by providing a Gmail search query (using standard Gmail search syntax) or by supplying a comma-separated list of explicit message IDs. This makes the block flexible for both dynamic, condition-based label updates and precise single-message operations.

The block accepts four main parameters beyond the Google OAuth connection: a query string, a messageIds string, an addLabelIds string, and a removeLabelIds string. Both the add and remove fields accept comma-separated label names or Gmail label IDs, and label names are resolved automatically. You can use either or both of the add and remove fields in a single operation.

This block fits into workflows that involve organizing, triaging, or routing email — for example, automatically labeling incoming messages based on content analysis, marking processed emails after an action has been taken, or removing labels as part of a multi-step email management pipeline. The block returns an array of Gmail message IDs that were successfully updated, which can be passed to downstream blocks for further processing.

What you can build

Real-world workflows powered by the Update Gmail Labels block.

Auto-Label Support Emails

Search for incoming emails matching support-related keywords and automatically apply a 'Support' label to route them for team review.

Mark Processed Invoices

After extracting invoice data from emails, add a 'Processed' label and remove an 'Unreviewed' label to reflect the updated status.

Flag High-Priority Messages

Apply a priority label to emails identified as urgent by an AI classification step earlier in the workflow.

Archive Completed Tasks

Remove an 'Action Required' label from emails once a linked task has been marked complete in a downstream step.

Categorize Newsletter Emails

Use a Gmail search query to find newsletter emails and apply a 'Newsletter' label for organized inbox management.

Label Emails by Sender Domain

Identify emails from specific sender domains using a search query and apply department or client-specific labels automatically.

Ready to add Update Gmail Labels to your workflow?

Get Started Free

Common questions about Update Gmail Labels

What are the required parameters for this block?

The block requires a Google OAuth connection ID and either a query (Gmail search syntax) or a messageIds field (comma-separated message IDs) to identify which messages to update. You also need to provide at least one of addLabelIds or removeLabelIds as comma-separated label names or IDs.

What does the block return?

The block outputs an updatedMessageIds field, which is an array of Gmail message ID strings representing the messages that were successfully updated.

Can I use label names instead of Gmail label IDs?

Yes. Both the addLabelIds and removeLabelIds fields accept either label names or Gmail label IDs, and label names are resolved automatically.

Do I need to provide both a query and messageIds?

No. You provide either a query or messageIds — they are alternatives for targeting messages. Using a query applies the label changes to all messages matching the Gmail search syntax, while messageIds targets specific messages directly.

What kinds of workflows commonly use this block?

This block is commonly used in email triage, inbox organization, and post-processing workflows — for example, labeling emails after AI classification, marking messages as handled after data extraction, or routing emails by applying category labels based on search queries.

Add Update Gmail Labels to your workflow

Build powerful AI workflows with drag-and-drop blocks. No coding required.