Automate Gmail Label Management with n8n Workflow

This n8n workflow automates managing Gmail messages by fetching emails with a specific label, removing that label, and applying a new one. It saves you time on manual email sorting, reducing errors and improving productivity.
gmail
manualTrigger
Workflow Identifier: 2414
NODES in Use: Manual Trigger, Gmail

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This n8n workflow moves emails from one Gmail label to another automatically.
It finds emails with a certain label, removes that label, and adds a new label instead.
This saves time by stopping manual work and stops mistakes when sorting emails.
You get better organized email with less effort and fewer errors.


Who should use this workflow

This workflow is useful for people who manage many emails with labels.
You may be a project manager, assistant, or anyone who sorts emails by categories.
If labeling emails by hand wastes hours weekly, this automation can help.


Tools and services used

  • Gmail API via Gmail node: Accesses and changes email labels.
  • n8n workflow automation: Runs the process and connects the steps.
  • OAuth2 credentials for Gmail: Securely connect n8n to Gmail account.

Beginner step-by-step: How to use this workflow in n8n

Step 1: Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. Open n8n editor (assume you already have it running).
  3. Click “Import from File” and select the downloaded workflow file.

Step 2: Configure credentials and labels

  1. Go to each Gmail node and add your Gmail OAuth2 credentials.
  2. Update the label IDs in the nodes to match your Gmail labels for fetch, remove, and add.
  3. Use the Gmail label IDs you want to move emails between (for example, original label ID and new label ID).

Step 3: Test and activate the workflow

  1. Run the workflow once by clicking “Execute Workflow” to check it works as expected.
  2. Look at the results to see emails fetched, labels removed, and new labels added.
  3. If all works, toggle the workflow switch to “Active” to run in production.

Optionally, replace the manual trigger with a Cron Trigger node to run automatically on schedule.
Use the n8n dashboard to watch executions and catch any errors.


Inputs, processing steps, and output

Inputs

  • The label ID to find emails by.
  • Gmail OAuth2 credentials.
  • The new label ID to apply.

Processing Steps

  • Fetch all emails with the given original label.
  • For each email, remove the old label.
  • Add the new label to each email.

Output

Emails now have the new label instead of the old one.
The inbox is cleaner and better organized.


Edge cases and failures

If Gmail shows “Invalid Credentials” error, check your OAuth2 tokens or refresh permissions.
Wrong label IDs cause “Label ID not found” errors, so double-check label IDs match Gmail exactly.

If all emails are not processed, the Gmail API may limit the amount fetched at once.
Enable pagination in the Gmail node or run the workflow multiple times to fix this.


Ideas for customization

  • Change label IDs to move emails between any labels you want.
  • Switch the manual trigger to a Cron trigger for automatic runs.
  • Add filters in Gmail nodes for sender or subject to move only certain emails.
  • Add a Slack or Email node after to notify you if any errors happen.
  • Use pagination settings to handle many emails in one run.

For hosting the workflow on your own server, see helpful resources on self-host n8n.


Summary

✓ Saves hours weekly by automating Gmail label moving.
✓ Stops manual errors in labeling emails.
✓ Keeps inbox organized automatically.
✓ Lets user run manually or schedule the task.
✓ Easy to customize label IDs and filters.


Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free