Based on a tutorial by n8n Official
Building workflows in n8n can be challenging if you don’t understand how data moves between nodes. You might be struggling with why your workflows aren’t behaving as expected or why your data isn’t formatted correctly.
I’ve summarized this comprehensive tutorial to help you grasp the essential data concepts in n8n. Understanding these fundamentals will dramatically improve your ability to build reliable, functional workflows.
Quick Navigation
Core Data Concepts: JSON & Lists (00:00-05:00)
To master n8n, you need to understand two primary data structures: JSON objects and lists. These form the foundation of how data flows through your workflows.
Key Points:
- JSON objects use curly brackets {} and consist of key-value pairs separated by commas
- Lists use square brackets [] and contain collections of items separated by commas
- JSON objects can be embedded (nested) within other JSON objects
- Lists can contain JSON objects, creating a structured data format
Understanding JSON Objects
JSON objects are written between curly brackets and made up of key-value pairs separated by commas. They’re a common way to store and transmit data in web applications.
{
"first_name": "Emily",
"last_name": "Johnson",
"email": "emily@example.com"
}
Embedded JSON Objects
JSON objects can contain other JSON objects, allowing for organized complex data structures:
{
"first_name": "Emily",
"last_name": "Johnson",
"email": "emily@example.com",
"location": {
"country": "USA",
"city": "New York"
}
}
To access data from JSON objects, you use dot notation. For example, $json.first_name
would return “Emily”, while $json.location.country
would return “USA”.
Working with Lists
Lists are collections of objects enclosed in square brackets and separated by commas. They can contain any type of data, including numbers, strings, and JSON objects.
[
{
"first_name": "Emily",
"last_name": "Johnson",
"email": "emily@example.com"
},
{
"first_name": "Michael",
"last_name": "Smith",
"email": "michael@example.com"
},
{
"first_name": "Sarah",
"last_name": "Williams",
"email": "sarah@example.com"
}
]
My Take:
Think of JSON objects as individual records in a database, and lists as tables containing multiple records. This mental model will help you understand how n8n processes your data.
Items & Node Execution (05:01-08:30)
In n8n, data is processed as “items” – each item typically being a JSON object within a list. Understanding how nodes interact with these items is crucial for building effective workflows.
Key Points:
- Nodes in n8n accept and return “items” (lists of JSON objects)
- Each node executes once per item in the input data (with some exceptions)
- Even empty outputs must return a list with an empty JSON object
- The “Execute once” parameter makes a node run only for the first item
Node Execution & Data Flow
When a node receives input, it processes each item separately. For example, if a “Date & Time” node receives three items with different dates, it will execute three times and format each date individually.
// Input to Date & Time node
[
{ "date": "2025-05-08" },
{ "date": "2024-12-25" },
{ "date": "2025-01-01" }
]
// Output after formatting to MM/DD/YYYY
[
{ "date": "2025-05-08", "formattedDate": "05/08/2025" },
{ "date": "2024-12-25", "formattedDate": "12/25/2024" },
{ "date": "2025-01-01", "formattedDate": "01/01/2025" }
]
Example Workflow Execution
Let’s examine a simple workflow that reads data from Google Sheets and filters it:
- Execute Workflow node returns an empty JSON object in a list
[{}]
- Google Sheets node executes once and returns three items (three rows from the sheet)
- Filter node checks each item against conditions and returns only matching items
My Take:
Visualizing the data flow between nodes will help you troubleshoot workflow issues. Remember that most operations in n8n happen on an item-by-item basis, which explains why some nodes produce unexpected results when you’re not considering this behavior.
Using Expressions in n8n (08:31-12:45)
Expressions allow you to dynamically access and manipulate data in your workflows. They’re enclosed in double curly brackets {{ }}
and can reference values from previous nodes.
Key Points:
- Expressions are enclosed in double curly brackets
{{ }}
- You can drag keys from the table/JSON view to create expressions
- Expressions reference item values using
$json.keyName
syntax - You can use JavaScript functions within expressions
- Expressions can combine multiple values and plain text
Creating Expressions
The n8n interface lets you build expressions by dragging keys from the output panel. This creates a reference to that specific data field for each processed item.
Example: Filtering Data with Expressions
If you want to filter items where the first name equals “Emily”, you’d create an expression like:
{{ $json.first_name }} == "Emily"
Combining Expressions with Text
Expressions can combine dynamic data with static text. For example, sending a Slack message with personalized content:
{{ $json.first_name }} {{ $json.last_name }} ({{ $json.email }}) just signed up to Acme!
This would produce messages like “Emily Johnson (emily@example.com) just signed up to Acme!” for each item in your input data.
My Take:
Expressions are where n8n becomes truly powerful. Take time to practice creating different expressions and see how they evaluate with your data. The ability to combine JavaScript functions with your workflow data opens up endless possibilities.
Practical Example: Working with Expressions (12:46-End)
The tutorial concludes with a practical demonstration of using expressions in the n8n interface with the “Edit Fields” node.
Key Points:
- The Edit Fields node allows adding or modifying data fields
- You can create expressions by dragging values from previous nodes
- JavaScript functions can transform data within expressions
- Expressions are evaluated individually for each item
Creating a “Full Name” Field
In this example, the tutorial demonstrates creating a new field called “full_name” that combines the first and last name fields:
{{ $json.first_name }} {{ $json.last_name }}
Using JavaScript in Expressions
To transform data, you can incorporate JavaScript methods. For example, converting the last name to uppercase:
{{ $json.first_name }} {{ $json.last_name.toUpperCase() }}
For example, “Paul Harris” would become “Paul HARRIS” after applying this expression.
My Take:
The Edit Fields node is one of the most useful nodes in n8n for data manipulation. By understanding how to use expressions effectively, you can transform, combine, and restructure your data to fit any downstream requirements.
This article summarizes the excellent tutorial created by n8n Official. If you found this summary helpful, please support the creator by watching the full video and subscribing to their channel.