Templates / Auto-label Gmail emails using Gemini 2.5 Pro AI classification

Auto-label Gmail emails using Gemini 2.5 Pro AI classification

Ready for 3.0

by Aryan Shinde ✓ · 1,372 views · created 2025-09-07 · Ticket Management, AI Summarization

Ready 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.

  1. Get many labels (Gmail): work with label
  2. Aggregate: combines items into one
  3. Edit Fields (Edit Fields (Set)): sets 1 field: labelList
  4. Message a model (Google Gemini): uses Google Gemini
  5. Code: runs custom JavaScript code
  6. Add label to message (Gmail): add labels

Services it uses

GmailGoogle Gemini

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)

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…

Excerpt from Aryan Shinde's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.