This is the n8n overview. See also: Item Flow, AI Agents in n8n, Self-Hosting.

n8n — Workflow Automation

n8n is an open-source workflow automation platform for building deterministic pipelines and autonomous AI agents. It connects APIs, databases, AI models, and custom code through a visual node-based editor.

Self-hosted or cloud. You own your data, workflows, and execution environment.

Core Concepts

ConceptWhat It Is
NodeA single operation: API call, data transform, AI model call, conditional check
WorkflowA chain of nodes connected by edges. Executes left-to-right.
TriggerThe first node — starts the workflow (webhook, schedule, form, chat, manual, error)
ItemA single data object flowing through the workflow. Nodes process items one at a time.
CredentialStored API key or auth token. Reusable across workflows. Never hardcoded.
ExpressionDynamic value using {{ }} syntax — pulls data from previous nodes
Sub-workflowA reusable workflow called from other workflows

The 17 Nodes to Master

These nodes cover ~90% of all production workflows:

#NodePurposeCategory
1WebhookReceive HTTP requests, return responsesTrigger
2ScheduleRun on cron (every hour, daily, etc.)Trigger
3HTTP RequestCall any API (GET, POST, PUT, DELETE)Integration
4SetCreate/transform fields, build test dataData
5IfBinary routing (true/false)Logic
6SwitchMulti-path routing (3+ outcomes)Logic
7LoopProcess items in batchesFlow
8Split OutArray to individual itemsData
9AggregateIndividual items to single arrayData
10MergeCombine data from parallel branchesData
11CodeCustom JavaScript/PythonTransform
12AI AgentAutonomous LLM with toolsAI
13Chat ModelDirect LLM call (no autonomy)AI
14Execute Sub WorkflowCall reusable sub-workflowsArchitecture
15Google SheetsRead/write/update rowsStorage
16PauseWait for human approvalControl
17Error HandlerCatch failures, route to recoveryReliability

Conditional Logic

Two outputs: true and false.

Order received → If (total >= $50) → true: Apply discount
                                   → false: Standard processing

Multiple named outputs for 3+ conditions.

Support ticket → Switch (priority) → low: Queue
                                    → medium: Assign agent
                                    → high: Alert team
                                    → VIP: Direct escalation

Rename Switch outputs from “0, 1, 2” to descriptive labels for readability.

Expressions & Variables

ModeBehaviorWhen
FixedLiteral text — hello means “hello”Static values
ExpressionDynamic — {{ $json.name }} pulls dataAlways for dynamic data
// Relative: immediate previous node
{{ $json.email }}

// Absolute: specific node by name (preferred)
{{ $('OpenAI').item.json.message.content }}

Always prefer absolute references ($('NodeName')) — they don’t break when you insert nodes between them.

Special VariablePurpose
$nowCurrent date/time
$fromAI("paramName", "desc")Let AI agent supply a parameter dynamically
$jsonCurrent item’s data
$('NodeName').item.jsonSpecific node’s output

Workflow vs. Agent — When to Use Which

CriteriaWorkflowAgent
LogicDeterministic, rule-basedAutonomous reasoning
PathFixed decision treeFlexible, AI-decided
Best forData transform, API orchestrationComplex reasoning, tool selection
ReliabilitySame input = same outputVariable
CostLow (no LLM calls)Higher (every decision = LLM call)
DebuggingEasy (follow fixed path)Harder (opaque reasoning)
Use workflows for the deterministic shell (triggers, data fetching, output formatting) and agents for the reasoning core (classification, generation, decision-making). Best of both worlds.

Common Workflow Templates

TemplatePatternKey Nodes
AI Inbox ManagerClassify > Route > RespondWebhook, AI Agent, Switch, Send Email
RAG Knowledge BaseUpload > Embed > Store > QuerySchedule, HTTP Request, Embeddings, Vector Store
Lead QualifierReceive > Research > Score > RouteWebhook, HTTP Request, AI Agent, If
Content PipelineResearch > Draft > Review > PublishSchedule, AI Agent, Pause (HITL), HTTP Request
Multi-Agent SystemOrchestrator > Specialists > MergeAI Agent, Execute Sub Workflow, Merge