Understanding Data in n8n | JSON, Lists & Items in n8n Explained

Learn Understanding Data in n8n | JSON, Lists & Items in n8n Explained in this comprehensive n8n tutorial. Step-by-step guide with video, code examples, and expert tips from the n8n Zero to Hero course.

Table of Contents

Overview

This lesson is part of the n8n AI Automation - Zero to Hero course, Section: 2. Getting Started.

Watch the video above for the full tutorial, or read the written guide below.

What is JSON and why does n8n use it?

JSON (JavaScript Object Notation) is the universal data exchange format that connects every app n8n integrates with. It stores data as key-value pairs, for example "order_number": "ORD001", and unlike a rigid spreadsheet table it lets each record carry a completely different set of properties. CRMs, Google Sheets, Slack, Discord, and every API n8n touches all speak JSON, making it the foundational language of automation.

JSON solves the rigidity problem that tabular data cannot. A smartphone order and a t-shirt order share header fields (order number, customer name, address) but need completely different product attributes. JSON nests objects inside objects, so product details live inside the order object, and each record describes exactly what it needs without forcing every field into the same columns. Think of it like a bento box where compartment sizes flex to fit the meal, not a fixed-grid cafeteria tray where protein and carbs must share equal space whether they fit or not.

JSON is also a plain text format, which means it compresses easily, transfers across networks cheaply, and parses reliably in every programming language. Those properties are why it became the dominant exchange format between applications and why n8n uses it internally for every node input and output.

How does a JSON list store multiple items in one structure?

A JSON list, also called an array, stores multiple items inside square brackets [ ]. Any time square brackets appear in JSON, everything inside is a collection of individual items that can each have different properties. A single order can contain a list of products: an iPhone with seven attributes and an Avengers t-shirt with five, with no requirement that both items share the same fields.

The distinction between a list and a single object matters in automation. Two separate orders with one product each are like two delivery boxes with one item apiece. One order with two products is one big box with two items inside. JSON describes both cleanly. The outer object holds the shared header data (order number, customer, address) and a key like products holds the array, with each product sitting inside its own { } block, separated by commas.

Commas separate items within the array, and the closing square bracket ends the list. Items inside the list do not need to be identical in structure. The smartphone can carry seven attributes while the t-shirt carries five, and JSON handles both without complaint.

How do you read a JSON value using dot notation?

Dot notation chains key names to walk into nested JSON objects, and square-bracket indexes pick a specific item out of a list. To reach the product name in the first order of a list variable called orders, write orders[0].order.product.name. The [0] grabs the first order (lists are zero-indexed, so position zero is first), each . steps into the next nested object, and the final key returns the value.

For a single-order variable called order_data there is no outer list, so you skip the index: order_data.order.products[0].name returns the first product name directly, and order_data.order.products[1].price returns the second product's price, which in the lesson example is $119.

The rule is: use square brackets with a number whenever you are selecting one item from a list, and use dot notation whenever you are stepping into a named object. Chaining both together lets you reach any value no matter how deeply nested. This exact syntax appears in n8n expressions whenever a node references data from a previous node, so mastering the pattern transfers directly to building workflows.

How does n8n represent and process JSON data as items?

In n8n, a list of JSON objects becomes a list of items, and every node processes each item individually. If a trigger node fetches ten customer orders, every downstream node applies its configured logic to all ten orders one at a time and passes ten output items forward. The item count stays consistent across nodes unless a node is specifically designed to merge or split data.

This per-item processing model means logic you configure once scales automatically to any volume of records. A workflow built to process one order handles a hundred orders without any changes. When debugging unexpected output, checking whether the item count entering a node matches what you expect, and whether the JSON keys you are referencing actually exist on every item, resolves the majority of data-flow mysteries.

Key Takeaways

  • JSON is the lingua franca of n8n integrations. Every app n8n connects to exchanges data as JSON key-value pairs, so understanding JSON structure is non-negotiable before building reliable automations.
  • Square brackets signal a list; curly braces signal an object. Whenever [ ] appears in JSON you are dealing with multiple items that each need a zero-based index ([0], [1]) to access individually.
  • Dot notation plus index chaining unlocks any value. Walk nested objects with dots and pick list items with indexes: orders[0].order.product.name retrieves the product name from the first order in the list.
  • Every n8n node processes items one at a time. A node receiving ten items applies its logic ten times and outputs ten items, so one well-configured node handles any volume of records automatically.
  • JSON beats tabular formats for heterogeneous data. A smartphone order and a t-shirt order coexist in the same list with completely different product attributes, something fixed spreadsheet columns cannot accommodate without creating separate tables.

Next Steps

Continue your n8n journey with the full n8n AI Automation - Zero to Hero course.

Frequently Asked Questions

JSON (JavaScript Object Notation) is a structured key-value pair format used by virtually every application to exchange data. In n8n, every node input and output uses JSON, because every external service n8n connects to, including CRMs, Google Sheets, Slack, and REST APIs, communicates in JSON. Understanding JSON structure is the foundation for reading, transforming, and troubleshooting data in any n8n workflow.

A JSON object stores named key-value pairs inside curly braces `{ }`, for example a single order with fields like order number and customer name. A JSON list, also called an array, stores multiple items inside square brackets `[ ]`, for example a list of products inside one order or a list of orders from a trigger. In n8n, lists become collections of items that each node processes individually.

Dot notation chains key names to step through nested objects, and square-bracket indexes select a specific item from a list. For a list variable called `orders`, `orders[0].order.product.name` returns the product name from the first order. Lists are zero-indexed, so `[0]` is the first item and `[1]` is the second. This same dot-and-bracket syntax is used directly inside n8n expressions to reference data from previous nodes.

n8n items are individual JSON objects inside the list of data passing through a workflow. When a trigger node fetches ten orders, it produces ten items. Every downstream node automatically applies its configured logic to each item separately and passes the same ten items forward. This per-item processing means a workflow built for one record scales to any number of records without additional configuration.

Dheeraj Sharma

Dheeraj Sharma

AI Systems Builder
Creator of the n8n Zero to Hero course (42 lessons, 31+ hours). I help solopreneurs build AI systems that grow revenue without growing workload.

Get the n8n Mastery Bundle

All workflows, cheat sheets, and premium resources from the entire course in one package.

Get Premium Resources