Best Ollama Models for n8n AI Agents (2026 Guide)
Description and use
The workflow processes up to 50 emails daily, automatically classifies them, drafts replies for routine messages, compiles a prioritized summary in Notion, and alerts the user via Slack about urgent items—all locally with no external API calls and zero monthly AI cost.
Problem
Automating email triage and drafting replies locally without sending data to cloud AI services, while keeping costs low and ensuring data privacy.
Outcome
The workflow processes up to 50 emails daily, automatically classifies them, drafts replies for routine messages, compiles a prioritized summary in Notion, and alerts the user via Slack about urgent items—all locally with no external API calls and zero monthly AI cost.
Workflow
- Install Ollama and pull desired model (e.g., llama3.1).
- Verify Ollama service is running on http://localhost:11434.
- Create an Ollama credential in n8n with Base URL http://localhost:11434.
- Build a schedule trigger for daily 7 AM execution.
- Add Gmail node to fetch unread emails from the last 24 hours (limit 50).
- Loop over each email item.
- Add AI Agent node: set model to Ollama/llama3.1, provide system prompt for email triage, and expose Gmail, Notion, Slack, and Calculator nodes as tools.
- Configure AI Agent to classify priority and type, draft replies for normal emails, create a Notion summary, and send a Slack message with urgent items.
- Test the workflow and enable it for production.
Evidence
With Ollama, the same workflow costs the electricity to run your server.
Llama 3.1 8B matches GPT‑4 on many benchmarks.
n8n added native Ollama support in version 1.28.
- Record date: 2026-09-09T18:45:28.584Z