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.
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).
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.
Method 2: Docker (Recommended for Production)
Docker provides a clean, isolated environment ideal for servers and VPS deployments.
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 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:
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
Practical AI Workflow Example
Here's a real-world AI workflow: automated email classification and response drafting.
Gmail Trigger
Monitors inbox for new emails. Extracts subject, sender, and body text.
AI Agent (GPT-4o)
Classifies the email as: sales inquiry, support request, partnership, or spam. Extracts key information (urgency, topic, required action).
Switch Node
Routes to different branches based on classification: support β CRM ticket, sales β notify sales team, spam β archive.
AI Draft Reply (Claude)
Generates a personalized draft response using your knowledge base context. Saves as Gmail draft for human review.
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: {{ }}
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:
- Go to Settings β Credentials in the n8n UI.
- Click Add Credential and search for the service.
- Fill in the required fields (API key, OAuth, etc.).
- Save β n8n encrypts and stores the credential automatically.
- Select the credential in any node that requires it.
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:
- Use PostgreSQL from day one if you plan to run more than 100 executions per day. SQLite's locking behavior causes failures under load.
- Enable execution pruning: Configure
EXECUTIONS_DATA_PRUNE=trueandEXECUTIONS_DATA_MAX_AGE=720to prevent your database from growing unbounded. - 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.
- Split large datasets with SplitInBatches node when processing hundreds or thousands of items. This prevents memory issues and allows parallel processing.
- Test with the "Manual" trigger first before switching to production triggers. Use pinned data to test specific scenarios without waiting for real events.
- Use Scriflow to generate your workflow JSON β describe what you want in English and get the complete n8n workflow configuration instantly.