Local AI Workflow Automation (n8n + Ollama)
n8n + Ollama = self-hosted Zapier with AI. Automate email processing, content generation, data enrichment, and more - all with local models on your own hardware.
Local AI Workflow Automation (n8n + Ollama) is a local AI stack for Automate tasks with AI-powered workflows, fully local and private. n8n + Ollama = self-hosted Zapier with AI. Automate email processing, content generation, data enrichment, and more - all with local models on your own hardware. It combines 6 components, is rated intermediate, and takes about 15 minutes to set up. Expect around $300 in hardware and $0/month versus cloud.
- Cost
- ~$300
- $0/mo vs cloud
- Difficulty
- intermediate
- Setup time
- ~15 min
- Use case
- Automate tasks with AI-powered workflows, fully local and private
~$300 hardware · $0/mo vs cloud
Local AI Workflow Automation (n8n + Ollama)
A self-hosted automation platform with AI built in. n8n is a visual workflow builder with 500+ integrations and native AI agent nodes. Connect it to Ollama for local LLM inference, and you get a private alternative to Zapier + ChatGPT - no monthly fees, no data leaks.
What you get
- Visual workflow builder - drag-and-drop for complex automations
- AI agent nodes - built-in agent loop, code interpreter, tool calling
- 500+ integrations - Slack, email, databases, webhooks, CRMs, and more
- Local LLM inference - Ollama serves models on your GPU, zero API costs
- Cron + webhook triggers - run on schedule or in response to events
- Self-hosted - no data leaves your network, air-gap compatible
- $0/mo - compared to $20-100+/mo for Zapier + OpenAI
Architecture
| Component | Role |
|---|---|
| n8n | Visual workflow engine with AI agent nodes |
| Ollama | Serves local LLM for AI steps in your workflows |
| Qwen3 14B | Default model - strong reasoning, fits 12GB |
| PostgreSQL / SQLite | Workflow state, execution history, credentials |
Recommended GPU: RTX 3060 12GB for 14B models. For CPU-only workflows, a Beelink S9 mini PC is enough.
Prerequisites
- A GPU with ≥12 GB VRAM for local LLM inference (optional - n8n works CPU-only without local AI)
- Docker + Docker Compose
- ~2 GB free disk for n8n + model storage
Setup
Docker Compose (Ollama + n8n)
Save this as docker-compose.yml:
services:
ollama:
image: ollama/ollama:latest
container_name: ollama
volumes:
- ollama:/root/.ollama
ports:
- "11434:11434"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
restart: unless-stopped
n8n:
image: docker.n8n.io/n8nio/n8n
container_name: n8n
depends_on:
- ollama
environment:
- N8N_RUNNERS_ENABLED=true
- GENERIC_TIMEZONE=America/New_York
- TZ=America/New_York
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
volumes:
- n8n_data:/home/node/.n8n
ports:
- "5678:5678"
restart: unless-stopped
volumes:
ollama:
n8n_data:Start it
docker compose up -dPull a model for AI-powered workflows:
docker exec ollama ollama pull qwen3:14bOpen http://localhost:5678 to access n8n.
Connect n8n to Ollama
In n8n, the Ollama node connects automatically when both containers are on the same Docker network. In the node config:
- Add an Ollama Chat Model node
- Set Base URL:
http://ollama:11434 - Select model:
qwen3:14b - Use it with n8n's AI Agent node for agentic workflows
Use it
Email Summarizer
- Trigger: Gmail / IMAP - new email received
- AI step: Ollama Chat Model - "Summarize this email in 2 sentences"
- Output: Slack - send summary to channel
Content Generator
- Trigger: Cron - every Monday at 9 AM
- AI step: Ollama Chat Model - "Write a weekly newsletter about [topic]"
- Output: Email - send to subscribers
Data Enricher
- Trigger: Webhook - receives CSV rows
- AI step: Ollama Chat Model - "Extract company name, industry, and location from this text"
- Output: PostgreSQL / Google Sheets - save enriched data
Smart Classifier
- Trigger: Webhook - incoming support tickets
- AI step: Ollama Chat Model - "Classify as billing/technical/feature-request and assign priority"
- Output: n8n Split - route to different teams
Cost vs cloud
| Local n8n + Ollama | Zapier + ChatGPT | |
|---|---|---|
| Monthly | $0 | $20-100+ |
| Hardware | ~$300 once (GPU) | $0 |
| Data safety | Stays on your LAN | Sent to cloud |
| AI calls | Unlimited, free | Token-limited |
| Workflows | Unlimited | Task-limited |
| Break-even | ~3-6 months | - |
After 3-6 months the hardware has paid for itself versus a Zapier subscription - and you get unlimited AI calls, unlimited workflows, and total privacy.
Troubleshooting
- n8n can't reach Ollama → Both services share the same Docker network in the compose file above. Use
http://ollama:11434as the base URL. - Slow AI responses → Check GPU usage. Smaller models like Mistral 7B are faster for simple tasks.
- No GPU in Ollama → Install the NVIDIA Container Toolkit and verify with
nvidia-smiin a test container. - n8n won't start → Check
docker compose logs n8n. Port 5678 might be in use; change the left-side port mapping.
Swap components
- CPU-only setup → Drop the GPU section from the compose file, use Mistral 7B GGUF on CPU (slower but works).
- Use Qdrant for memory → Add Qdrant as a vector store for RAG-enabled workflows.
- Prefer another LLM → Swap the Ollama node for n8n's built-in OpenAI or Anthropic nodes if you want hybrid.
- SQLite vs PostgreSQL → n8n defaults to SQLite. For production, add a PostgreSQL container and set
DB_TYPE=postgresdb.
Frequently asked
What is the Local AI Workflow Automation (n8n + Ollama) stack for?
n8n + Ollama = self-hosted Zapier with AI. Automate email processing, content generation, data enrichment, and more - all with local models on your own hardware. It is purpose-built for Automate tasks with AI-powered workflows, fully local and private and runs entirely on your own hardware.
How much does the Local AI Workflow Automation (n8n + Ollama) stack cost?
Local AI Workflow Automation (n8n + Ollama) costs around $300 in hardware up front and $0/month to run, since everything is self-hosted — no per-token or subscription fees versus a cloud equivalent.
How long does it take to set up Local AI Workflow Automation (n8n + Ollama)?
Plan for roughly 15 minutes. The stack is rated intermediate.
What do I need to run Local AI Workflow Automation (n8n + Ollama)?
Local AI Workflow Automation (n8n + Ollama) is built from 2 tool(s), 2 model(s), 2 hardware item(s). Each is listed below with a link.