Home / use case

Auto-label Gmail and draft replies with a local model (n8n)

At a glance
Models & engines
Self-hosted n8n (recommended for Ollama connectivity)
Ollama at http://localhost:11434 with e.g. mistral

What they built

Tony Adijah's n8n template for people drowning in email. It classifies, labels and drafts replies using a model running locally in Ollama.

Setup

  • Self-hosted n8n (recommended for Ollama connectivity)
  • Ollama at http://localhost:11434 with e.g. mistral
  • Gmail OAuth (read, modify, compose); Google Sheets optional

How it works

  1. Gmail trigger checks unread mail (default every 30 minutes)
  2. Ollama returns category, priority, confidence, summary, action, sentiment and an optional reply draft
  3. A router applies one of six labels: Urgent, Action Required, Follow-up, Newsletter, Automated, Spam-Promo
  4. Drafts are created for Urgent and Action Required mail
  5. Every email is logged to Google Sheets

Do it yourself

  1. Create the six Gmail labels and look up their IDs
  2. Import the template and connect Gmail OAuth
  3. `ollama pull mistral` and set the model in the Ollama node
  4. Send yourself test emails and run manually to check accuracy
Source: n8n templates · Added 2026-10-18. This write-up summarizes the original source; see it for full details.

Similar setups

An n8n and Ollama email triage prototype: Qwen3 8B found the task, but not whose it was

Adam wired n8n to Qwen3 8B in Ollama on an Apple Silicon Mac to turn emails into structured task assessments, and found the model spotted actions but missed when they belonged to someone else.

Adam (DEV Community) · 2026-11-01

Self-hosted AI email assistant on Linux (n8n + Ollama)

Classifies IMAP mail with llama3.1:8b, routes it, saves reply drafts and extracts action items as JSON. Reports 85-95% classification accuracy.

Linux Professional · 2026-10-18

Email triage and morning digest with a local Ollama model (n8n)

Classifies each email as URGENT, REPLY_TODAY, FYI or JUNK using gemma4:e4b, sends urgent alerts and builds a grouped morning digest.

n8n templates · 2026-10-18

Ollama next to n8n on a CPU-only VPS: measured speed and RAM

A developer measured how fast Ollama runs Llama 3.x models on an 8-vCPU VPS with no GPU, and how much RAM a self-hosted n8n really uses beside it, and published the raw numbers.

DEV Community (ricco020) · 2026-12-01