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
- Download the workflow file using the Download button on this page.
- Open n8n editor (assume you already have it running).
- Click “Import from File” and select the downloaded workflow file.
Step 2: Configure credentials and labels
- Go to each Gmail node and add your Gmail OAuth2 credentials.
- Update the label IDs in the nodes to match your Gmail labels for fetch, remove, and add.
- 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
- Run the workflow once by clicking “Execute Workflow” to check it works as expected.
- Look at the results to see emails fetched, labels removed, and new labels added.
- 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.
