Home / use case

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

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.

Related

Self-hosted bookmarks that tag themselves with local AI (Karakeep)

Karakeep (formerly Hoarder) runs on a Debian LXC, and gemma3:4b in Ollama tags each bookmark. Getting reliable tags from a small model takes one key setting.

peira.dev · 2026-09-04

Hybrid workflow: local for private and repetitive, cloud for hard

A Linux sysadmin stopped trying to replace cloud LLMs. Ollama now handles private docs, overnight article summaries and VS Code autocomplete.

XDA Developers · 2026-05-11

Read-only personal admin assistant over work email and calendar

A project manager juggling a dozen projects has a local bot that builds a wiki from email, surfaces to-dos, sends reminders and drafts replies.

Reddit r/LocalLLM · 2026-04-29

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-03-08