n8n Workflow Automation AI Agents 8 min read

n8n Guide 2025: Open-Source AI Workflow Automation

A practical guide to n8n for developers and no-code builders — from self-hosted Docker setup to building AI Agent workflows with LLMs, memory, and popular integrations.

What Is n8n?

n8n (pronounced "nodemation") is an open-source workflow automation platform that lets you connect apps, APIs, and AI models through a visual node-based interface. Think of it as a self-hostable Zapier with AI capabilities built in.

The key differentiator is self-hosting: unlike Zapier or Make.com, you can run n8n on your own VPS, in Docker, or on Railway/Render — for free, with unlimited executions, and with complete data privacy. Your workflows and the data flowing through them stay on your infrastructure.

As of 2024, n8n added native AI nodes powered by LangChain — AI Agent, LLM Chain, Memory nodes, Vector Store nodes, and more — making it the most capable open-source platform for building agentic AI automations.

n8n vs Zapier vs Make.com

Feature n8n Zapier Make.com
Self-hostable Yes (free) No No
Free plan Self-host unlimited 100 tasks/mo 1,000 ops/mo
AI Agent node Native (LangChain) Basic (Zapier AI) OpenAI module only
Code nodes JS + Python JS only No
Integrations 400+ native + HTTP 7,000+ apps 1,500+ apps
Cloud price $24/mo Starter $19.99/mo Starter $9/mo Core
Data privacy Full (self-host) US cloud only EU cloud option

Core Concepts

Nodes

Every action in n8n is a node. Nodes are divided into: Trigger nodes (start a workflow — Webhook, Schedule, Email trigger), Regular nodes (do work — HTTP Request, Code, Google Sheets, Slack), and Sub-nodes (used inside AI nodes — Chat Model, Tool, Memory, Vector Store).

Workflows

A workflow is a canvas of connected nodes. Data flows as JSON arrays between nodes — each node receives an array of items and outputs an array of items. You can split and merge branches with Merge, Switch, or IF nodes.

Credentials

API keys and OAuth tokens are stored as Credentials, separated from workflows. They're AES-256 encrypted at rest. One credential can be shared across multiple workflows. Set up credentials at Settings > Credentials.

Expressions

Reference data from previous nodes with double-curly syntax: {{ $json.email }} or {{ $node['HTTP Request'].json.body }}. Expressions support JavaScript — you can call string methods, parse dates, and do arithmetic inline.

AI Nodes in n8n

n8n's AI nodes are built on LangChain and use a sub-node pattern — you drag nodes onto the AI node's input slots rather than connecting them with edges.

Basic LLM Chain

Simplest AI node — takes a prompt, sends it to an LLM, returns the response. Use when you need a single LLM call (summarize, classify, extract). Requires a Chat Model sub-node (OpenAI, Anthropic, Gemini, Mistral, Ollama).

AI Agent

The full ReAct agent — the LLM decides which tools to call based on the task. Requires a Chat Model + at least one Tool sub-node. Built-in tools: Calculator, Wikipedia, Code Execution, HTTP Request, Gmail, Google Calendar, Slack. The agent loops until it reaches a final answer.

Memory nodes

Connect to AI Agent for persistent conversation history. Options: Window Buffer Memory (last N messages, in-process), SQLite Memory (persistent across executions, use Session ID = user ID), Redis Memory (shared across multiple n8n instances).

Vector Store nodes

Embed documents and query them in AI workflows. Supported: Pinecone, Qdrant, Supabase (pgvector), In-Memory Vector Store. Use for RAG — retrieve relevant chunks from your knowledge base and pass to the LLM.

# Supported Chat Model providers in n8n AI nodes

OpenAI          → GPT-4o, GPT-4o mini, o3 mini
Anthropic       → Claude Sonnet 4.6, Claude Haiku 4.5, Claude Opus 4.8
Google Gemini   → Gemini 2.0 Flash, Gemini 1.5 Pro
Mistral         → Mistral Large, Mistral Small
Ollama          → Any local model (Llama 3.3, DeepSeek, Phi-3, etc.)
Azure OpenAI    → All deployed GPT-4o / o3 variants
Cohere          → Command R+
Groq            → Llama 3.3 70B, Mixtral 8x7B (fast inference)

Practical Example: Webhook → AI Summarize → Slack

A common pattern: receive content via webhook, summarize it with an LLM, notify your team in Slack.

1

Webhook trigger

Add a Webhook node. Set HTTP Method to POST. Copy the Production URL. Toggle the workflow ON. External services POST JSON to this URL to start the workflow.

2

Basic LLM Chain node

Add a Basic LLM Chain node. Connect an Anthropic Chat Model sub-node (set model to claude-sonnet-4-6). Set the prompt to: "Summarize this in 3 bullet points: {{ $json.body.content }}"

3

Slack node

Add a Slack node (Send Message). Set Channel to your target channel. Set Message to {{ $json.text }} (the LLM Chain output). Add your Slack OAuth credential.

Total nodes: 3. Total setup time: ~10 minutes. This workflow runs serverlessly on n8n Cloud or continuously on self-hosted Docker.

Self-Hosting with Docker

# Minimal Docker Compose for n8n

version: '3.8'
services:
  n8n:
    image: n8nio/n8n:latest
    restart: always
    ports:
      - "5678:5678"
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER=admin
      - N8N_BASIC_AUTH_PASSWORD=your_password
      - WEBHOOK_URL=https://your-domain.com  # Must be public URL for webhooks
      - GENERIC_TIMEZONE=UTC
    volumes:
      - n8n_data:/home/node/.n8n

volumes:
  n8n_data:

Run with docker compose up -d. Access at http://localhost:5678. For AI workflows, allocate at least 4 GB RAM — LangChain-based AI nodes are memory-intensive. Set N8N_EXECUTIONS_DATA_PRUNE=true to prevent execution log buildup.

For production: use Railway, Render, or a $10/mo DigitalOcean Droplet. Add a PostgreSQL service instead of the default SQLite for multi-user reliability. Enable EXECUTIONS_TIMEOUT=3600 for long-running AI Agent tasks (default 5 min on Cloud, 300s on self-hosted).

Pricing

Self-Hosted

Free

Unlimited executions, unlimited workflows, all features. Sustainable Use License — commercial use allowed if n8n is not the product you're selling. Run on any server, Docker, Railway, or Render.

n8n Cloud Starter

$24/mo

2,500 workflow executions/mo, 5 active workflows, managed hosting, automatic updates. Best for low-volume automation without infrastructure management.

n8n Cloud Pro

$60/mo

10,000 executions/mo, unlimited active workflows, 30-min execution timeout (vs 5 min on Starter), version history, custom variables. Best for production AI automation workloads.

Is n8n Down?

n8n Cloud outages can silently break your AI automation pipelines. Prismix tracks n8n status and alerts you before your workflows stop running.