Templates / Auto-label Gmail with Ollama AI and draft smart replies

Auto-label Gmail with Ollama AI and draft smart replies

Ready for 3.0

by Tony Adijah ✓ · 387 views · created 2026-02-17 · 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 16 nodes and runs on Gmail events. Along the way it connects Gmail, Google Sheets and Ollama Chat Model.

How it runs

Trigger: On Gmail events.

  1. 🔧 Extract Email Data (Code): runs custom JavaScript code
  2. 🤖 AI Email Classifier (AI Agent): runs an AI agent, with model: Ollama Chat Model
  3. 🎯 Extract Classification (Code): runs custom JavaScript code
  4. 🔀 Route by Category (Switch): routes items into 6 branches
  5. 🏷️ Label: Urgent (Gmail): add labels
  6. 🏷️ Label: Action Required (Gmail): add labels
  7. 🏷️ Label: Follow-up (Gmail): add labels
  8. 🏷️ Label: Newsletter (Gmail): add labels
  9. 🏷️ Label: Automated (Gmail): add labels
  10. 🏷️ Label: Spam-Promo (Gmail): add labels

…plus 4 more steps. See the full node list below.

Services it uses

GmailGoogle SheetsOllama 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).

Nodes used (7)

From the author

Who is this for This workflow is built for professionals, founders, freelancers, and anyone drowning in email who wants to automatically triage their inbox using AI — sorting emails into categories, applying Gmail labels, and generating reply drafts for…

Excerpt from Tony Adijah'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.