n8n is the self-hosted alternative to Zapier and Make — a visual workflow automation tool with 400+ integrations and a node-based editor. Combined with Ollama for local LLM inference, you can build AI-powered automations that process emails, summarize documents, classify data, and trigger actions, all without sending your data to any external AI API. Your email content, your documents, and your business logic stay on your infrastructure.
Get more guides like this in your inbox
No spam. Unsubscribe anytime.
Deploy with Docker Compose
The fastest way to get both n8n and Ollama running is with Docker Compose:
# docker-compose.yml
services:
ollama:
image: ollama/ollama:latest
volumes:
- ollama_data:/root/.ollama
ports:
- "11434:11434"
restart: unless-stopped
n8n:
image: docker.n8n.io/n8nio/n8n:stable
ports:
- '5678:5678'
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER=admin
- N8N_BASIC_AUTH_PASSWORD=your-secure-password
- OLLAMA_BASE_URL=http://ollama:11434
- N8N_RUNNERS_ENABLED=true
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
volumes:
- n8n_data:/home/node/.n8n
depends_on:
- ollama
restart: unless-stopped
volumes:
ollama_data:
n8n_data:Workflow 1: Email Summarization and Triage
This workflow connects to your email inbox, summarizes each email with Ollama, classifies it by urgency, and routes it to the appropriate folder or sends a Slack notification for urgent items. The email content never leaves your infrastructure.
# Workflow structure:
# [Email Trigger] → [Ollama: Summarize] → [Ollama: Classify] → [Switch] → [Gmail: Label] / [Slack: Notify]
# Summarization prompt:
# "Summarize this email in 2-3 sentences. Email: {{ $json.text }}"
# Classification prompt:
# "Classify as URGENT, NORMAL, or LOW priority. Respond with one word only.
# Email summary: {{ $json.summary }}"Workflow 2: Document Intelligence Pipeline
This workflow watches a folder, extracts text from PDFs and Word documents, generates embeddings using Ollama's embedding models, and stores them in a local vector database. The result is a searchable knowledge base built entirely from your private documents.
# Pull the embedding model
docker exec ollama ollama pull nomic-embed-text
# Workflow:
# [Filesystem Trigger] → [Read File] → [Extract Text] →
# [Split Into Chunks] → [Ollama: Embed] → [Qdrant: Upsert]
# Query workflow:
# [Webhook: question] → [Ollama: Embed question] → [Qdrant: Search] →
# [Ollama: Generate answer with context] → [Webhook: respond]Workflow 3: Scheduled AI Research Digest
This workflow runs every morning, fetches RSS feeds from your chosen sources, uses Ollama to filter and summarize relevant articles, and sends a personalized digest to your email or Slack. Your reading interests and the article content never leave your infrastructure.