How a Workflow Works
Every workflow starts with a Trigger node and flows data through connected Action nodes. Data passes between nodes as JSON arrays called "items".
Understanding Items
n8n passes data as an array of items. Each item has a json property. Every node outputs items that the next node receives.
Trigger Node Types
Pick the right trigger for your automation context.
| ⏰ Schedule | Cron-based |
| 🌐 Webhook | HTTP POST/GET |
| 🖱️ Manual | Test runs |
| IMAP polling | |
| 📦 App Events | Slack, GitHub… |
Setting Up Credentials
Credentials are stored securely and reused across nodes. Never hardcode secrets in expressions.
{{$env.MY_API_KEY}} to inject secrets at runtime.Running Workflows
Three ways to execute — each suited for different scenarios.
$json — Current Item Data
Access fields from the current item's JSON object inside any field using double curly braces.
$node — Get Data from Any Node
Pull data from a specific upstream node by referencing its name.
Global Variables
n8n provides several built-in variables available everywhere.
DateTime Expressions
n8n uses Luxon under the hood for date manipulation.
String Manipulation
Use native JavaScript string methods directly inside expressions.
Safe Access & Defaults
Prevent workflow crashes from missing or null values.
?? on optional fields to avoid node failures on partial data.HTTP Request Node
The workhorse for any REST API. Supports all HTTP methods, auth, headers, query params, and JSON bodies.
Set Node — Transform Data
Rename, add, or overwrite fields on each item. Use "Keep Only Set" to strip unwanted fields.
IF & Switch — Branch Logic
Route items down different paths based on conditions. Switch handles multiple branches cleanly.
Split In Batches + Merge
Process large datasets in chunks and reassemble. Essential for APIs with rate limits.
Code Node (Function)
Full JavaScript execution. Return an array of items. Has access to all n8n variables.
Webhook Node
Receive data from any external service via HTTP. Supports GET, POST, and custom responses.
Pin Data for Testing
Pin output on any node so it always returns the same data during development — no live API calls needed while building downstream nodes.
Error Workflow Pattern
Attach an Error Trigger workflow to catch failures, send alerts, and log issues automatically.
Deduplicate with $vars
Use workflow static variables to track processed IDs and skip already-seen records.
Rate Limit Requests
Add a Wait node between batches to respect API rate limits and avoid 429 errors.
Execute Workflow Node
Call another workflow as a function — great for reusable logic like sending formatted emails or syncing records.
Flatten Nested Arrays
When an API returns nested arrays, use the Code node to flatten them into individual items.
Webhook → Process → Respond
Receive an HTTP request, process data synchronously, and return a JSON response to the caller.
Schedule → Fetch → Notify
Periodic job that pulls data from an API and sends a formatted report to Slack or email.
Paginated API Fetch
Loop through all pages of a paginated API until no more pages remain.
Two-Way Sync Between Apps
Keep records in two systems in sync using upsert logic — update if exists, create if not.
AI Enrichment Pipeline
Feed items through an AI node (OpenAI/Claude) to classify, summarize, or extract data, then route by AI output.
Retry on Failure
Wrap unreliable nodes in a retry loop with exponential backoff to handle transient errors gracefully.
Canvas Navigation
| Execute workflow | Ctrl + Enter |
| Save workflow | Ctrl + S |
| Add node | Tab |
| Undo | Ctrl + Z |
| Redo | Ctrl + Shift + Z |
| Select all nodes | Ctrl + A |
| Zoom to fit | Ctrl + Shift + F |
| Reset zoom | Ctrl + 0 |
Node Interactions
| Open node | Enter or double-click |
| Delete node | Delete / Backspace |
| Duplicate node | Ctrl + D |
| Copy node | Ctrl + C |
| Paste node | Ctrl + V |
| Disable node | D (while selected) |
| Close panel | Esc |
| Move canvas | Middle-click drag |