Templates / Smart Gmail auto-labeler with Gemini AI & sender history

Smart Gmail auto-labeler with Gemini AI & sender history

Ready for 3.0

by Muhammad Anas Farooq ✓ · 226 views · created 2025-12-05 · 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-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This AI workflow has 16 nodes and runs manually, when you click “Execute workflow” (plus 1 other trigger). Along the way it connects Gmail and Google Gemini Chat Model.

How it runs

Trigger: Manually, when you click “Execute workflow” (plus 1 other trigger).

  1. Get many messages (Gmail): get many
  2. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  3. Check Label Existence (Code): runs custom JavaScript code
  4. If: checks a condition and branches into true / false
  5. Email Classifier Agent (AI Agent): runs an AI agent, with model: Google Gemini Chat Model; 2 tools (Get Emails By Label, Get Emails By Sender Email); output parser: Structured Output Parser
  6. If: checks a condition and branches into true / false
  7. Convert Label to Label ID (Code): runs custom JavaScript code
  8. Add label to thread (Gmail): add labels (thread)
  9. Remove Inbox label from thread (Gmail): remove labels (thread)
  10. Get Labels Info (Gmail): work with label

Services it uses

GmailGoogle Gemini Chat Model

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).
Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (10)

From the author

n8n Gmail AI Auto-Labeler > An intelligent n8n workflow that automatically classifies and labels Gmail emails using Google Gemini AI, keeping your inbox organized with zero manual effort. This workflow uses AI-powered classification to analyze email…

Excerpt from Muhammad Anas Farooq'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.