Auto-label Gmail emails using Gemini 2.5 Pro AI classification
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.
What this workflow does
This AI workflow has 7 nodes and runs on Gmail events. Along the way it connects Gmail and Google Gemini.
How it runs
Trigger: On Gmail events.
- Get many labels (Gmail): work with label
- Aggregate: combines items into one
- Edit Fields (Edit Fields (Set)): sets 1 field: labelList
- Message a model (Google Gemini): uses Google Gemini
- Code: runs custom JavaScript code
- Add label to message (Gmail): add labels
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
- Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).
Nodes used (6)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Google Gemini
@n8n/n8n-nodes-langchain.googleGemini - Gmail
n8n-nodes-base.gmail - Edit Fields (Set)
n8n-nodes-base.set - Aggregate
n8n-nodes-base.aggregate - Code
n8n-nodes-base.code
From the author
AI-Powered Gmail Auto-Labeler Automatically organize your Gmail inbox with seamless, dynamic AI classification! This workflow leverages Google Gemini’s latest model to continually sort new emails into your own custom Gmail labels—no manual intervention or…