Library
N8N Foundation · Chapter 3 of 10
Chapter 03

Mastering Nodes &
Expressions

Fifteen core nodes and the expression language that binds them. After this chapter you can build any workflow — the rest is just picking the right integration.

NodesExpressionsJavaScriptJSON
A Handbook For Builders
Mastering Nodes &
Expressions
Chapter 03
The Claude Code Handbook

Fifteen nodes cover 90% of real workflows. Learn them cold — inputs, outputs, quirks — and the 400+ integration nodes become a menu, not a mystery. This chapter is a reference you will come back to. Bookmark it.

Section 1

1. HTTP Request

The universal node. If an API exists, this node can call it.

jsonclaude-code
{
  "method": "POST",
  "url": "https://api.example.com/v1/leads",
  "authentication": "genericCredentialType",
  "sendHeaders": true,
  "sendBody": true,
  "specifyBody": "json",
  "jsonBody": "={{ { name: $json.name, email: $json.email } }}"
}
Section 2

2. Webhook

Two URLs: a Test URL that only fires while the editor is open, and a Production URL live once the workflow is Active.

Section 3

3. Set

Reshape items. Add fields, rename fields, drop everything else.

jsclaude-code
full_name  = ={{ $json.first + ' ' + $json.last }}
email_low  = ={{ $json.email.toLowerCase() }}
source     = "webhook"
Section 4

4. Code (JavaScript)

jsclaude-code
const out = [];
for (const item of items) {
  out.push({ json: { id: item.json.id, total: item.json.qty * item.json.price } });
}
return out;
Section 5

5. Function vs Code Node

Older workflows use Function. The modern Code node replaces it. Prefer Code.

Section 6

6. Merge

  • Append — concat arrays.
  • Combine by matching fields — SQL-style join on a key.
  • Combine by position — zip two lists by index.
  • Choose Branch — take whichever side arrives first.
Section 7

7. Split In Batches

Chunks big item lists. Essential for rate limits.

Section 8

8. Switch

Multi-way IF. Route on {{ $json.type }} to different branches.

Section 9

9. IF

jsclaude-code
{{ $json.plan }} equal "pro"
{{ $json.mrr }} largerEqual 50
Section 10

10. Wait

Pause the workflow — for N seconds, until a date, or until a webhook is called.

Section 11

11. Loop Over Items

Modern alias for Split In Batches with size 1.

Section 12

12. Execute Workflow

Call another workflow like a function.

Section 13

13. Respond to Webhook

jsclaude-code
{{ { ok: true, id: $json.id, ts: $now.toISO() } }}
Section 14

14. Sticky Notes

Yellow rectangles on the canvas. Annotate why a node exists.

Section 15

15. Expressions

Any field prefixed with = is evaluated as an expression.

jsclaude-code
={{ $json.customer.name }}
={{ $node["HTTP Request"].json.token }}
={{ $json.mrr > 100 ? "vip" : "std" }}
Section 16

16. Built-in Variables

  • $json — current item's JSON.
  • $input.all(), $input.first() — array helpers.
  • $node["Name"].json — reach into any upstream node.
  • $now, $today — Luxon DateTime objects.
  • $env.NAME — process env variable.
Section 17

17. String / Date / Math

jsclaude-code
={{ $json.email.toLowerCase().trim() }}
={{ $now.plus({ days: 7 }).toFormat('yyyy-LL-dd') }}
={{ Math.round($json.total * 1.2 * 100) / 100 }}
Section 18

18. Real Examples

  1. Slugify a title.
  2. Currency format with Intl.NumberFormat.
  3. Guard against nulls.
Section 19

19. Quick Exercises