Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära JSON Basics | Datatyper i n8n
AI-Automationsarbetsflöden med n8n

bookJSON Basics

Note
Definition

JSON is a structured, universal data format that gives workflows a predictable way to represent values and objects. It keeps data consistent across HTTP requests, webhooks, APIs, and node outputs, making it easier for tools to read, compare, and transform information without errors.

JSON is essentially a pattern, the same fields appearing in the same places every time. Almost everything in n8n relies on two core shapes: Objects and Arrays. Data moves between nodes as an array of items, where each item contains a $json object. When the structure is consistent, workflows run smoothly; when it's off, nodes start to misbehave.

Object with Named Fields

customer.json

customer.json

copy

Curly braces { } represent an object, a structured record made up of key–value pairs. You can think of it like a single spreadsheet row, where each column header (key) has a corresponding cell value.

Array or List of things

A list of values. It is used when you just need simple items in order:

customers.json

customers.json

copy

A list of objects. It is used when each item has its own fields or attributes:

products.json

products.json

copy

Square brackets [ ] represent an array, an ordered list of items. You can think of it as multiple spreadsheet rows, each one holding similar structured data.

Note
Note

An object represents one thing, while an array represents many. Mix up the brackets, and the parser will complain.

These are the core data types that make up every JSON structure.

Most API payloads are simply combinations of these building blocks.

How n8n Actually Represents JSON

In n8n, every node outputs data in a consistent structure: an array of items, where each item contains a $json object. You can view and manipulate this data in different ways, but the underlying structure always stays the same.

  • Each node outputs an array of items, each holding a $json object;
  • Access specific fields using expressions like {{$json["customer"]["first_name"]}};
  • Switch between Schema, Table, and JSON views, they show the same data differently;
  • Use Split Out / Item Lists to break arrays into individual items;
  • Use Aggregate / Item Lists to combine multiple items back into a single list for AI or batch processing.
question mark

What does each item in an n8n node’s output array contain?

Select the correct answer

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 2

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

Suggested prompts:

Can you give me an example of a JSON object and array?

How do I know when to use an object versus an array in my data?

What are some common mistakes people make when working with JSON?

Awesome!

Completion rate improved to 4.17

bookJSON Basics

Svep för att visa menyn

Note
Definition

JSON is a structured, universal data format that gives workflows a predictable way to represent values and objects. It keeps data consistent across HTTP requests, webhooks, APIs, and node outputs, making it easier for tools to read, compare, and transform information without errors.

JSON is essentially a pattern, the same fields appearing in the same places every time. Almost everything in n8n relies on two core shapes: Objects and Arrays. Data moves between nodes as an array of items, where each item contains a $json object. When the structure is consistent, workflows run smoothly; when it's off, nodes start to misbehave.

Object with Named Fields

customer.json

customer.json

copy

Curly braces { } represent an object, a structured record made up of key–value pairs. You can think of it like a single spreadsheet row, where each column header (key) has a corresponding cell value.

Array or List of things

A list of values. It is used when you just need simple items in order:

customers.json

customers.json

copy

A list of objects. It is used when each item has its own fields or attributes:

products.json

products.json

copy

Square brackets [ ] represent an array, an ordered list of items. You can think of it as multiple spreadsheet rows, each one holding similar structured data.

Note
Note

An object represents one thing, while an array represents many. Mix up the brackets, and the parser will complain.

These are the core data types that make up every JSON structure.

Most API payloads are simply combinations of these building blocks.

How n8n Actually Represents JSON

In n8n, every node outputs data in a consistent structure: an array of items, where each item contains a $json object. You can view and manipulate this data in different ways, but the underlying structure always stays the same.

  • Each node outputs an array of items, each holding a $json object;
  • Access specific fields using expressions like {{$json["customer"]["first_name"]}};
  • Switch between Schema, Table, and JSON views, they show the same data differently;
  • Use Split Out / Item Lists to break arrays into individual items;
  • Use Aggregate / Item Lists to combine multiple items back into a single list for AI or batch processing.
question mark

What does each item in an n8n node’s output array contain?

Select the correct answer

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 3. Kapitel 2
some-alt