Affiliate/Ads disclaimer: Some links on this blog are affiliate/ads links to support this project going on, meaning I may earn a commission at no extra cost to you.
n8n Nodes & Techniques: Core Nodes, Expressions & Code Guide
n8n nodes execute specific operations—API calls, data transformations, conditional routing, and stream merging—within a workflow. The platform provides 400+ native integration nodes alongside core nodes like HTTP Request, Set, Code, IF, and Merge that form the backbone of every automation. Expressions and JMESPath add dynamic data manipulation without custom scripts.
How does the HTTP Request node call any REST API in n8n?
The HTTP Request node sends HTTP calls to any REST endpoint using methods GET, POST, PUT, PATCH, or DELETE. It parses JSON, XML, and binary responses, supports custom headers and authentication, and handles pagination and error codes. You configure the URL, method, and optional body in the node parameters panel. [1]
The HTTP Request node serves as the universal integration adapter: when n8n lacks a dedicated integration for a third-party API, this node provides full access. Combine it with credential-based authentication for secure API calls. For branching based on response data, follow it with an IF or Switch node.
How does the Set node modify JSON fields in n8n workflows?
The Set node adds, edits, or removes JSON key-value pairs from workflow data. It provides a visual field editor where you map a field name to a value or expression. Use “Keep Only Set” to drop unlisted fields, effectively reshaping the JSON structure to match downstream node requirements. [2]
Advanced patterns include setting fields to dynamic expression results
like {{ $json.orderTotal * 1.2 }} for tax calculation, or
injecting values from
environment variables
for environment-specific configuration.
Which languages does the n8n Code node support, and how do you use it?
The n8n Code node executes custom JavaScript (Node.js 18) or Python (Pyodide-based Python 3.x) as a workflow step. JavaScript mode supports Promises, console.log debugging, and—on self-hosted instances—importing external npm modules. Python mode runs via WebAssembly with Pyodide’s built-in package set. [3]
Two execution modes are available: “Run Once for All Items” (default) executes the code once regardless of input count; “Run Once for Each Item” runs per item. The Code node replaces the legacy Function and Function Item nodes from n8n v0.198.0 onward. For complex data wrangling that exceeds visual nodes, see our n8n benefits and use cases.
N8N_PYTHON_ENABLED=true environment variable (default in
v2.0+).
[4]
How do n8n expressions and JMESPath query and transform workflow data?
n8n expressions use double curly braces {{ }} to reference
previous node outputs, environment variables, and built-in functions
dynamically. JMESPath, a JSON query language, extracts and transforms
nested JSON elements through the $jmespath() method. Both
methods work inside Set, IF, and other node parameter fields.
[5]
| Method | Syntax | Use Case |
|---|---|---|
| Expressions | {{ $json.field }} |
Simple field references, math, string concatenation |
| $jmespath() | {{ $jmespath($json, "people[*].name") }} |
Filter, project, and reshape nested JSON arrays |
JMESPath supports five projection types—list, slice, object, flatten, and filter—that handle deeply nested API responses without custom code. For complex logic beyond expressions, use the Code node to write full JavaScript or Python.
How does the IF node enable conditional branching in n8n?
The IF node evaluates a true/false condition and routes each data item along one of two output branches. Conditions can compare string values, numbers, dates, or expression results—for example, checking if an invoice total exceeds $1,000. Items that match go to the true branch; all others go to the false branch. [6]
Pair IF with a Merge node for the Split‑Process‑Merge pattern: split data by condition, process each branch independently, then recombine. For multi-way routing (three or more paths), use the Switch node instead.
How does the Merge node combine multiple data streams in n8n?
The Merge node consolidates data from two or more upstream branches into a single unified output. It supports append (stack items), join (match by key), and SQL-style merge operations. The append mode collects all input items into one flat list; join mode pairs items sharing a matching property value. [7]
A critical pattern is Split → Process → Merge: branch with IF or Switch, transform each path independently, then reunify with Merge. This avoids duplicating logic and keeps workflows maintainable. For large-scale data handling, consider the n8n architecture and scaling strategies.
