Lesson 8easy15 min

n8n Fundamentals: Nodes, Data Flow & JSON

Master n8n core data architecture, item arrays, expressions, and execution states.

Learning Objectives

  • Understand the n8n data structure: arrays of JSON items
  • Use expressions like $json and $item to reference values
  • Differentiate between triggers, regular action nodes, and sub-nodes

n8n Fundamentals: Nodes, Data Flow & JSON

Every node in n8n receives an array of objects and outputs an array of objects. Understanding this pipeline structure prevents subtle bugs.

The Item Array Structure

Data flows through n8n as an array of items, each containing a json object:

[
  {
    "json": {
      "id": 101,
      "email": "alex@example.com",
      "status": "active"
    }
  },
  {
    "json": {
      "id": 102,
      "email": "sarah@example.com",
      "status": "pending"
    }
  }
]
Advertisement

Referencing Values with Expressions

n8n provides expressions to query context from previous steps:

  • {{ $json.email }}: References the email field of the current incoming item.
  • {{ $('Trigger Node').item.json.body.userId }}: Explicitly references data from a named preceding node.
  • {{ $now.toFormat('yyyy-MM-dd') }}: Uses Luxon date helpers directly in expressions.

Pin Data for Rapid Testing

When testing nodes downstream, you can click Pin Data on any node. This caches the execution payload so you can iterate on downstream nodes without re-running long API calls or wasting LLM tokens.