What is n8n? The Complete Automation Guide for 2026

n8n (pronounced "n-eight-n" or "nodemation") is one of the most powerful open-source workflow automation platforms available today. Unlike SaaS tools like Zapier or Make, n8n gives you full control over your automations: you can self-host it on your own server, customize every aspect, write custom JavaScript or Python code, and connect to virtually any API or service without per-task pricing.

In this complete guide, you'll learn everything you need to know about n8n in 2026: what it is, how it works, how to install it, its most important nodes, real use cases, and how to leverage its AI capabilities with LangChain and OpenAI.

⚑ Quick Summary

n8n is a free, open-source automation platform with 400+ integrations. It can be self-hosted for unlimited workflows and executions at no cost, or used via their cloud offering. It's the go-to tool for developers and technical teams who want maximum flexibility.

What is n8n? The Basics Explained

n8n was created by Jan Oberhauser in 2019 and has grown into one of the most starred automation projects on GitHub with over 45,000 stars. The name comes from "node" and "automation" β€” the two core concepts that define the platform.

At its heart, n8n is a visual workflow builder. You create automations by connecting "nodes" on a canvas β€” each node performs a specific action (sending an email, querying a database, calling an API, etc.). When nodes are connected in sequence, they form a workflow that executes automatically based on a trigger.

The n8n Philosophy

What makes n8n unique compared to competitors is its underlying philosophy:

  • Fair-code licensed: n8n's source code is publicly available. You can modify it, self-host it, and use it commercially under their Sustainable Use License.
  • Developer-first: Unlike Zapier's "no-code only" approach, n8n embraces code. You can write JavaScript or Python directly inside workflows with the Code node.
  • Data privacy by design: When self-hosted, your data never leaves your infrastructure. This is critical for GDPR compliance and enterprise use cases.
  • No per-execution pricing: Self-hosted n8n runs unlimited workflows for free. You only pay for server costs.

How n8n Works: Nodes, Workflows & Executions

Understanding n8n's architecture is essential to using it effectively. Everything in n8n revolves around three core concepts:

1. Nodes

Nodes are the building blocks of every n8n workflow. Each node represents a single action or integration. There are several categories:

  • Trigger nodes: Start the workflow (e.g., Webhook, Schedule/Cron, Gmail Trigger, new row in Google Sheets).
  • Action nodes: Perform operations like sending emails, inserting database records, or calling APIs.
  • Logic nodes: Control flow β€” IF conditions, Switch, loops, Merge, Split in Batches.
  • AI nodes: Connect to OpenAI, Anthropic, Google Gemini, or build full AI Agents with LangChain.
  • Transform nodes: Manipulate data β€” Set/Edit Fields, Code node, Function node.

2. Workflows

A workflow is a collection of connected nodes forming an automation pipeline. Workflows can be:

  • Active: Running and ready to respond to triggers.
  • Inactive: Saved but not running (useful during development).
  • Manual: Triggered by clicking "Execute Workflow" for testing.

3. Executions

Each time a workflow runs is called an "execution." n8n stores execution history so you can debug failures, inspect the data flowing through each node, and re-run past executions. In self-hosted mode, execution logs are stored in your database (SQLite by default, or PostgreSQL for production).

πŸ’‘ Pro Tip

Use PostgreSQL instead of SQLite for production self-hosted n8n. SQLite struggles with concurrent executions and large execution history. PostgreSQL handles thousands of executions per day without issues.

How to Install n8n: 3 Methods

There are three main ways to get n8n running. Choose based on your use case:

Method 1: Quick Start with npx (Development)

The fastest way to try n8n locally. Requires Node.js 18+ installed.

# Install and start n8n immediately npx n8n # n8n will be available at http://localhost:5678 # Data is stored in ~/.n8n

Method 2: Docker (Recommended for Production)

Docker provides a clean, isolated environment ideal for servers and VPS deployments.

# Basic Docker run command docker run -it --rm \ --name n8n \ -p 5678:5678 \ -v ~/.n8n:/home/node/.n8n \ n8nio/n8n # For production with Docker Compose (recommended) # Create docker-compose.yml:
version: '3.8' services: n8n: image: n8nio/n8n restart: always ports: - "5678:5678" environment: - N8N_BASIC_AUTH_ACTIVE=true - N8N_BASIC_AUTH_USER=admin - N8N_BASIC_AUTH_PASSWORD=yourpassword - WEBHOOK_URL=https://n8n.yourdomain.com/ - DB_TYPE=postgresdb - DB_POSTGRESDB_HOST=postgres volumes: - n8n_data:/home/node/.n8n postgres: image: postgres:15 environment: - POSTGRES_DB=n8n - POSTGRES_USER=n8n - POSTGRES_PASSWORD=n8npassword

Method 3: n8n Cloud

The managed cloud version at n8n.io requires zero server setup. Plans start at $20/month with 2,500 workflow executions included. Ideal if you don't want to manage infrastructure.

⚠️ Cloud vs Self-Hosted

Cloud n8n limits executions and charges per workflow run. Self-hosted n8n has no execution limits but requires server maintenance. For teams with high volume automations, self-hosted is dramatically cheaper.

n8n's Most Important Nodes

n8n has 400+ nodes covering every major service and integration. Here are the essential nodes you'll use in 90% of workflows:

Webhook
n8n-nodes-base.webhook
Receives HTTP requests to start workflows. Supports GET, POST, PUT, DELETE. Essential for real-time integrations.
Schedule Trigger
n8n-nodes-base.scheduleTrigger
Runs workflows on a schedule using cron expressions. Perfect for batch jobs and periodic tasks.
HTTP Request
n8n-nodes-base.httpRequest
Makes HTTP calls to any REST API. Supports all methods, authentication, headers, and pagination.
Google Sheets
n8n-nodes-base.googleSheets
Read, write, update, and delete rows in Google Sheets. The workhorse for data collection workflows.
Gmail
n8n-nodes-base.gmail
Send emails, read inbox, manage labels, and create drafts. Full Gmail API integration.
Slack
n8n-nodes-base.slack
Send messages, create channels, manage users. The go-to for team notification workflows.
IF (Condition)
n8n-nodes-base.if
Branches the workflow based on conditions. Routes data to different paths depending on field values.
Code
n8n-nodes-base.code
Execute JavaScript or Python directly in the workflow. Access all incoming data, external libraries, and return custom output.

Top n8n Use Cases in 2026

n8n's flexibility makes it suitable for virtually any automation need. Here are the most impactful use cases organizations are implementing:

1. Lead Management Automation

Capture leads from web forms (Typeform, HubSpot forms, custom webhooks) β†’ enrich contact data via Clearbit or Hunter.io API β†’ add to CRM (HubSpot, Salesforce, Pipedrive) β†’ send personalized welcome email β†’ notify the sales rep via Slack. This entire process happens in under 5 seconds, 24/7, without human intervention.

2. E-commerce Order Processing

Receive order webhooks from Shopify or WooCommerce β†’ update inventory in a Google Sheet or PostgreSQL database β†’ generate invoice via Stripe API β†’ send order confirmation email with PDF attachment β†’ create shipping label via ShipStation API β†’ notify warehouse via Slack.

3. AI-Powered Customer Support

Receive customer email β†’ extract question using OpenAI GPT-4 β†’ search knowledge base (Notion, Confluence) for relevant answers β†’ generate personalized reply with AI β†’ send response via Gmail β†’ log interaction to CRM. Response time drops from hours to seconds.

4. Data Pipeline & ETL

Run nightly at midnight β†’ extract data from multiple APIs (Google Analytics, Stripe, CRM) β†’ transform and normalize data β†’ load into BigQuery or PostgreSQL data warehouse β†’ generate summary report β†’ email to management team. Replaces complex ETL pipelines with a visual workflow.

5. Social Media Monitoring

Trigger on keyword mentions in Twitter/X API β†’ filter by sentiment using AI β†’ for negative mentions: create urgent Slack alert and CRM ticket β†’ for positive mentions: save to spreadsheet and trigger re-engagement campaign.

n8n vs Zapier vs Make: Quick Comparison

Feature n8n Zapier Make (Integromat)
Open Source βœ“ Yes βœ— No βœ— No
Self-Hosted βœ“ Yes βœ— No βœ— No
Free Tier βœ“ Unlimited (self-hosted) 100 tasks/month 1,000 ops/month
Code Support βœ“ JS + Python Limited (Code by Zapier) Limited
AI/LangChain Nodes βœ“ Native Via Zapier AI Via HTTP Request
Integrations 400+ 6,000+ 1,500+
Best For Developers, enterprises Non-technical users Complex visual logic

For a detailed breakdown, read our full n8n vs Zapier vs Make comparison.

n8n with AI & LangChain in 2026

One of n8n's most powerful capabilities is its native integration with AI systems. Starting from n8n version 1.0, the platform introduced dedicated AI Agent nodes built on LangChain, making it the most capable automation tool for AI-powered workflows.

AI Agent Node

The AI Agent node creates a ReAct-style agent that can reason, plan, and use tools to accomplish goals. You provide:

  • A system prompt defining the agent's role and capabilities
  • A chat model (OpenAI GPT-4, Claude, Gemini, Llama, etc.)
  • Tools the agent can use (web search, code execution, database queries, API calls)
  • Memory for conversation history

Available AI/LLM Nodes

AI Agent
@n8n/n8n-nodes-langchain.agent
Full LangChain ReAct agent with tool calling, memory, and multi-step reasoning.
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
GPT-4o, GPT-4 Turbo, GPT-3.5 models for chat completions and embeddings.
Anthropic (Claude)
@n8n/n8n-nodes-langchain.lmChatAnthropic
Claude 3.5 Sonnet, Claude 3 Opus for high-quality reasoning and analysis tasks.
Google Gemini
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
Gemini 1.5 Pro and Flash models, multimodal support for image analysis.

Practical AI Workflow Example

Here's a real-world AI workflow: automated email classification and response drafting.

1

Gmail Trigger

Monitors inbox for new emails. Extracts subject, sender, and body text.

2

AI Agent (GPT-4o)

Classifies the email as: sales inquiry, support request, partnership, or spam. Extracts key information (urgency, topic, required action).

3

Switch Node

Routes to different branches based on classification: support β†’ CRM ticket, sales β†’ notify sales team, spam β†’ archive.

4

AI Draft Reply (Claude)

Generates a personalized draft response using your knowledge base context. Saves as Gmail draft for human review.

πŸ’‘ Generate This Workflow Instantly

Instead of building this workflow manually, use Scriflow to generate the complete n8n JSON configuration from a natural language description. Free, no signup required.

n8n Expressions: Accessing Data Between Nodes

One of n8n's most powerful features is its expression system, which lets you reference data from any previous node in the workflow. Expressions use double curly braces: {{ }}

// Reference data from the previous node {{ $json.email }} {{ $json.name }} // Reference data from a specific node by name {{ $node["Gmail Trigger"].json.subject }} {{ $node["HTTP Request"].json.data.userId }} // Built-in variables {{ $now }} // Current timestamp (Luxon DateTime) {{ $today }} // Today's date {{ $workflow.id }} // Current workflow ID {{ $execution.id }} // Current execution ID // JavaScript expressions work too {{ $json.price * 1.2 }} // 20% markup calculation {{ $json.name.toUpperCase() }}// String manipulation {{ $json.items.length }} // Array length {{ new Date().toISOString() }} // Current ISO date

Managing Credentials in n8n

n8n has a secure credential manager that stores API keys, OAuth tokens, and passwords encrypted in the database. All credentials are encrypted using AES-256 before storage.

To add credentials:

  1. Go to Settings β†’ Credentials in the n8n UI.
  2. Click Add Credential and search for the service.
  3. Fill in the required fields (API key, OAuth, etc.).
  4. Save β€” n8n encrypts and stores the credential automatically.
  5. Select the credential in any node that requires it.
⚠️ Security Best Practice

Always set the N8N_ENCRYPTION_KEY environment variable when self-hosting. This key is used to encrypt credentials. If you lose it, all saved credentials become unreadable. Back it up securely.

n8n Community & Resources

n8n has a thriving community and rich ecosystem of resources:

  • n8n Community Forum: community.n8n.io β€” thousands of workflow templates, troubleshooting help, and feature discussions.
  • n8n Workflow Templates: n8n.io/workflows β€” 1,000+ ready-to-use workflow templates for every use case.
  • GitHub Repository: github.com/n8n-io/n8n β€” open-source code, issue tracker, and contribution guidelines.
  • YouTube Channel: Official tutorials and use-case demonstrations.
  • Discord Server: Real-time community support and discussion.

Pro Tips for Getting Started with n8n

After building hundreds of workflows, here are the most valuable lessons:

  1. Use PostgreSQL from day one if you plan to run more than 100 executions per day. SQLite's locking behavior causes failures under load.
  2. Enable execution pruning: Configure EXECUTIONS_DATA_PRUNE=true and EXECUTIONS_DATA_MAX_AGE=720 to prevent your database from growing unbounded.
  3. Use the Error Workflow feature to get notified on any workflow failure. Create a dedicated error-handling workflow that sends alerts to Slack or email.
  4. Split large datasets with SplitInBatches node when processing hundreds or thousands of items. This prevents memory issues and allows parallel processing.
  5. Test with the "Manual" trigger first before switching to production triggers. Use pinned data to test specific scenarios without waiting for real events.
  6. Use Scriflow to generate your workflow JSON β€” describe what you want in English and get the complete n8n workflow configuration instantly.

Frequently Asked Questions

What is n8n used for?
n8n is used for automating repetitive tasks and connecting different software applications. Common uses include: syncing data between apps, sending automated emails/notifications, processing form submissions, building AI agents, creating data pipelines, automating CRM updates, and integrating internal tools with external APIs. It replaces manual work that would otherwise require custom code or expensive SaaS tools.
Is n8n free to use?
Yes β€” the self-hosted version of n8n is free with no execution limits. You only pay for the server (a $5-10/month VPS is sufficient for most teams). The cloud version (n8n.io) has paid plans starting at $20/month. The open-source community edition is free forever under n8n's Sustainable Use License.
Do I need to know programming to use n8n?
No, but it helps. n8n is primarily visual and most workflows can be built without writing code. However, the Code node (JavaScript/Python) unlocks much more power for complex data transformations. Intermediate users often use expressions ({{ $json.field }}) for data mapping, which is straightforward even without programming background.
How does n8n compare to Zapier?
n8n is more powerful and flexible but has a steeper learning curve. Zapier has 6,000+ integrations vs n8n's 400+, but n8n compensates with the HTTP Request node that can connect to ANY REST API. n8n is dramatically cheaper at scale (self-hosted = unlimited free executions vs Zapier's $19-799/month plans). Zapier is better for non-technical users who want to get started in minutes.
What is the best way to host n8n in production?
The recommended production setup is Docker Compose with PostgreSQL on a Linux VPS (DigitalOcean, Hetzner, or AWS). Use Nginx or Caddy as a reverse proxy with SSL. Enable authentication, set a strong encryption key, configure execution pruning, and set up regular database backups. A $12/month Hetzner VPS can handle hundreds of thousands of executions per month.
Can n8n work with AI models like ChatGPT?
Yes. n8n has native AI nodes for OpenAI (GPT-4o, GPT-4 Turbo), Anthropic (Claude 3.5), Google Gemini, Mistral, and local models via Ollama. The AI Agent node implements full LangChain-based agents with tool calling, memory, and multi-step reasoning. This makes n8n the most powerful tool for building AI-augmented automations.