How JSON items, mapping and expressions work in n8n
Follow items through a workflow and fix a broken field mapping using expressions and the execution data.
By Invicly Tech, , in n8n, AI Automation and Voice Agents. About 9 minutes to read.
In short
Data in n8n moves between nodes as a list of items. Each item is a small JSON object, and most nodes run once for every item. Expressions, written between double curly braces, let one node read values produced by an earlier node.
Think of it like this: Items are like index cards in a tray. Each node picks up the tray, works on every card, and hands on a new tray.
Explained simply
In n8n, data travels as items. An item is one record, like one appointment request. A node usually receives several items at once and handles each in turn. You can see them in the table or JSON view on the output side of any node.
Each item holds its fields inside a part called json. A request might have name, email and slot. When a later node needs the email, it asks for it with an expression. An expression is a tiny instruction written between double curly braces, such as {{ $json.email }}.
The word $json means the current item. If three items arrive, the expression is worked out three times, once for each. This is called per-item scope, and it is why one node can personalise ten messages without a loop.
Mistakes are normal. A field might be spelled differently, nested one level deeper, or empty. n8n saves what went into and out of every node in the execution. Compare the input panel with your expression and the problem usually shows itself.
Press Play on a diagram to walk through it one step at a time.
- 1Item list
An array. The node output you see in the table or JSON view.
- 2Item
One entry in that array. Nodes usually run once per item.
- 3json
The main data of the item: the fields you map and test.
- 4binary (optional)
Attached files such as images or PDFs.
- 5Fields
Strings, numbers, booleans, nested objects and arrays inside json.
- 1Run the workflow
Execute and open the failing node
- 2Read the input panel
What actually arrived?
- 3Compare the field name
Spelling, case and nesting
- 4Correct the expression
Drag the field from the input panel
- 5Re-run the node
Check the output item count and values
- Current item, previous node
- Most common choice
- Short and readable
- Matching item from a named node
- Use when data is several steps back
- Breaks if the node is renamed
- The full list from a node
- Use for counts and totals
- Returns an array, not one value
In depth
The shape of an item list
Under the table view, a node output is a list of objects. Each object has a json key that holds your fields. Some items also have a binary key for files. When you add an Edit Fields node, you can create new fields or change existing ones, and the item list goes on to the next node.
Nested data keeps its shape. If a field is an object, you reach into it with dots: {{ $json.customer.email }}. If it is an array, you use an index: {{ $json.slots[0] }}. Keeping these paths in mind makes the input panel easy to read.
- Output is an array of items
- Fields live under json
- Dots reach into objects
- Square brackets reach into arrays
- name
- Ada Test
- customer
- phone
- slots
- [0]
- [1]
Mapping fields between nodes
Mapping means feeding a value from one node into a parameter of the next. The simplest way is to drag a field from the input panel onto the parameter. n8n writes the expression for you and shows a live preview of the result.
Expressions are JavaScript, so you can do small changes inline: {{ $json.name.toUpperCase() }} or {{ $json.slot.slice(0, 10) }}. Keep these short. If an expression becomes long, move the logic into its own node so you can see its output.
Reaching back to earlier nodes
The current item comes from the node just before. To use data from a node further back, name it. {{ $('Webhook').item.json.email }} reads the email of the matching item in the node called Webhook. The word item follows the link between items, so the right record is found even after several steps.
If you rename a node, expressions that mention it by name need updating. n8n offers to update references, but check the result. Short, clear node names make expressions easier to read.
- $json is the current item
- $('Name').item follows the matching item
- $('Name').all() returns every item from that node
- Rename nodes carefully
Finding a mapping mistake in execution data
Run the workflow, then open the node that gave the wrong value. Look at its input first: is the field there, with the spelling and nesting you expected? If the input is wrong, the fault is in an earlier node, so walk back one node and repeat. If the input is right, the fault is in your expression.
Common causes are a different capital letter, a field nested one level deeper, a value that is a number where you wanted text, and an empty string where you assumed the field was missing.
Learn it in 5 short steps
About 35m each. Track them with a timer in your plan.
- 1Read the item list structure~35m
- 2Map fields between nodes~35m
- 3Write expressions that reference earlier nodes~35m
- 4Understand per-item scope~35m
- 5Use execution data to find a mapping mistake~35m
Key points
- Each node receives a list of items and, by default, runs once per item.
- Inside a node, {{ $json.email }} reads the email field of the current item.
- To reach an earlier node, name it: {{ $('Webhook').item.json.email }}.
- Dragging a field from the input panel into a parameter writes a correct expression for you and avoids typos.
- Execution data shows the input and output of every node, so a wrong or empty value can be traced to the node that produced it.
Key terms
Tap a card to flip it. 0/5 known
Examples
[
{ "json": { "name": "Ada Test", "slot": "2026-03-02T09:00" } },
{ "json": { "name": "Bo Sample", "slot": "" } }
]
// In an Edit Fields node:
// customer = {{ $json.name }}
// first = {{ $json.name.split(' ')[0] }}
// origin = {{ $('Manual Trigger').item.json.name }}Two items arriving at a node, and expressions that read them.
Fix an empty email in a confirmation message
A node should write a message to each customer but the email field comes out empty. Step 1: open the execution and select the node. Step 2: read the input panel and find that the field is called Email, with a capital E. Step 3: change the expression to match, run again, and see the right value on all three items.
Before: {{ $json.email }} -> (empty)
Input item: { "Email": "ada@example.com" }
After: {{ $json.Email }} -> ada@example.comUse an earlier node and a list
After an HTTP Request node the data is the service response, but you still want the customer name from the start of the flow. Read it from the trigger by name. Then use .all().length in a later node to report how many requests entered.
name: {{ $('Manual Trigger').item.json.name }}
status: {{ $json.statusCode }}
count: {{ $('Manual Trigger').all().length }}Quick reference
- {{ $json.field }} reads a field of the current item.
- {{ $json.a.b }} reaches into a nested object; {{ $json.list[0] }} picks an array entry.
- {{ $('Node name').item.json.field }} reads from an earlier node.
- {{ $('Node name').all().length }} counts the items a node produced.
- Drag fields from the input panel to avoid typos.
- Field names are case sensitive.
- Nodes run once per item unless the setting says otherwise.
Common mistakes
- Writing {{ $json.Name }} when the field is name. Field names are case sensitive.
- Expecting one result from a list: an expression runs once per item, not once for the whole list.
- Looking only at a node's output and not its input when hunting a mapping bug.
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
Add an Edit Fields node that creates a field called greeting with the value Hello, followed by the item name.
- Exercise 2medium
Build three items with a Code node or Edit Fields. Make one use the field key Email instead of email, then find out why a later expression returns empty for it.
- Exercise 3hard
After an HTTP Request, produce one item per request with the original name plus the response status, without a loop.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- What is the difference between an item and a field?
- An item is one whole record. Fields are the named values inside it, such as name and email.
- Do I need to know JavaScript to use expressions?
- Not much. Reading fields and small changes like toUpperCase() or slice() cover most cases. Move anything longer into its own node.
- Why does my expression work in the preview but fail in a run?
- The preview may use pinned or test data. Check the real input in the execution data.