Advertisement
Verified Partner
Enterprise Cloud Infrastructure, GPU Clusters & AI APIs
Deploy high-throughput inference and quant trading pipelines with ultra-low latency.
Explore Platform β†’

n8n Automation Cheatsheet: Core Nodes, Expressions, Credentials and Error Workflows

n8n quick reference: the core nodes that appear in every workflow, expression syntax with {{ }}, how data and credentials flow, and the error-handling setup that keeps automations alive.

πŸ§ͺ
Run & Edit this Code Live in Browser Zero setup required. Supports Python 3, modern JavaScript, and SQL.
β–Ά Run in Playground β†’

1. Core Nodes You Will Use in Every Workflow

Workflows are triggers plus transformations plus actions. These twelve nodes cover most real automations; learn them first.

NodeRole in the workflow
Manual TriggerStart on click β€” for testing and one-off runs
Schedule TriggerRun on a cron schedule (every hour, weekdays at 9:00…)
WebhookStart when an HTTP request hits your unique URL; can respond synchronously
HTTP RequestCall any API: method, URL, headers, body, authentication
CodeTransform items with JavaScript (Run Once for All Items is the common mode)
Edit Fields (Set)Build or reshape the JSON each item carries
IFBranch on a condition: true path and false path
SwitchRoute items to one of several outputs by value
Split OutTurn one item with an array field into many items
MergeCombine two branches back into one stream of items
WaitPause execution (resume after a time or a webhook call)

2. Expressions: {{ }} Is Where Data Moves

Any field in any node can hold an expression between double curly braces. Expressions read the JSON of incoming items and the output of earlier nodes by name.

CODE SNIPPET
// Data from the current item
{{ $json.email }}                    // field of the incoming item
{{ $json.body.customer.name }}      // nested field (webhook payloads sit under body)

// Data from an earlier node, by its exact name
{{ $('HTTP Request').item.json.id }}      // paired item
{{ $('HTTP Request').first().json.token }} // first output item
{{ $('HTTP Request').all() }}              // every output item

// Dates and environment (Luxon under the hood)
{{ $now.toISO() }}                        // current timestamp
{{ $now.minus({ days: 7 }).toFormat('yyyy-MM-dd') }}
{{ $env.API_BASE_URL }}                    // environment variable

// Inside the Code node the same data is plain JavaScript
return items.map(item => ({ json: { ...item.json, seen: true } }));
Advertisement
Verified Partner
Quantitative Trading Systems & 30 AI Business Blueprints
Build predictable monthly recurring revenue with retainers & automated bots.
View Blueprints β†’

3. Data Flow and Credentials

Two ideas prevent most beginner pain: items stay linked across nodes (paired items), and secrets live in credentials that nodes reference β€” never pasted into fields.

  • Items are the unit of data. Most nodes run once per item; an execution with 50 incoming items runs the next node 50 times.
  • Paired items keep the chain traceable. Expressions pointing at earlier nodes follow the pairing to the matching item β€” keep the default unless you deliberately switch to .first() or .all().
  • Create credentials once, reuse everywhere. Settings β†’ Credentials stores API keys and OAuth connections encrypted; nodes just select the credential by name.
  • OAuth2 is the default for Google, Slack and friends: create the credential, click Connect, approve in the browser β€” tokens refresh automatically.
  • Generic credentials cover the rest: Header Auth (API key in a header), Basic Auth and Bearer-style tokens for services without a dedicated node.
  • Pin data while building. Pinning a node output freezes sample data so downstream nodes can be edited without re-running upstream API calls.

4. Error Workflows: Automations That Survive

Every production workflow needs a failure path: configure it once, and add retries where the flaky call lives.

  • Workflow Settings β†’ Error Workflow: point the workflow at a dedicated error workflow. It starts with an Error Trigger node and receives the failed workflow name, node and error message β€” send it to Slack or email.
  • Node Settings β†’ Retry On Fail: retry up to a set number of times with a wait between tries; built for rate limits and flaky APIs.
  • Node Settings β†’ On Error β†’ Continue: let the execution proceed and handle the failure in the next node by checking $json.error in an IF node.
  • Stop And Error node: raise a deliberate, readable failure when data is invalid instead of letting a later node crash cryptically.
  • Executions view is your logbook: every run (success or error) keeps its full item data for inspection and re-running from the failed node.

πŸš€ Associated Learning Path & Monetization Blueprints

πŸ“š Comprehensive Pillar Guide

n8n AI Agents and Automation Workflows

Build complete AI-agent automations on top of these nodes, expressions and error patterns.

Read Full Guide β†’
πŸ’° Monetizable AI Blueprint

Autonomous B2B Lead Enrichment

Sell n8n automations that enrich and route B2B leads around the clock.

Read Blueprint β†’
πŸ“ˆ Topic Hub: LLMs & Autonomous Agents β†’

Need another cheat sheet?

We add new reference guides every week based on community requests.

Request a Cheatsheet β†’