MyPrivateClaw logo
MyPrivateClaw
Private AI Directory
Self-Hosted AI 12 min readMar 30· Updated Apr 11, 2026✓ Verified Mar 30, 2026

Self-Hosted n8n + Ollama: Build Private AI Workflows

Combine n8n's visual workflow automation with Ollama's local LLM inference to build AI pipelines where your data never leaves your infrastructure.

n8n ollama automation workflows self-hosted privacy

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.

THE EDGE — WEEKLY DIGEST

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:

bash
# 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.

bash
# 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.

bash
# 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.

TIPFor the research digest workflow, Qwen3.5 9B is the recommended model — it's fast enough to process 50+ articles in under 2 minutes on a machine with 8 GB VRAM, and its instruction-following is reliable enough that the YES/NO relevance filter rarely makes mistakes.
Read next

RELATED GUIDES