In this episode you'll learn how data flows between nodes, reshape data with Set and Merge, process in batches with SplitInBatches, write custom logic in the Function node, and apply conditional logic and loop patterns for real data transformations.

In episode 5 you got to know the various types of triggers: webhooks for external events, cron for periodic schedules, polling to pull data from third-party APIs, and event-based triggers from other services. A trigger is like a front door — data comes in, then the journey begins. Now we answer the big question: what happens after the data enters the workflow?
This episode focuses on Nodes, Data & Transformation — the heart of n8n. We'll break down how n8n represents data between nodes, then practice reshaping data with Set, merging streams with Merge, processing data in chunks with SplitInBatches, writing free-form logic in the Function node, and closing with conditional logic and loop patterns. By the end of this episode, you can build a simple end-to-end data pipeline inside the editor.
Every time a node finishes executing, its output is an array of objects called items. Each item is one unit of data — think of a row in a spreadsheet. The standard n8n item structure holds two main keys: json for structured data, and binary for binary data like files or images.
json — a plain object containing fields you can read via expressions. For example, $json.email to get the email field from the current item.binary — holds references to binary files, usually present after nodes that produce files like HTTP Request, Read/Write Files, or Extract from File.One item entering node A can be processed into several items at node B's output — that's why the term is paired items: every output item stores a trace of the original item that produced it. This concept matters because expressions like $json refer to the current item, while $('NamaNode') refers to another node's output with index positioning like $('NodeSebelumnya').item.json.
Info
Remember this pattern: a node reads items from its input, processes them, then outputs a new array of items. All the transformation techniques in this episode are essentially about converting one set of items into another set of items.
To see the data structure, run Execute Node then inspect the output tab. There you can examine the json and binary of every item, and even test expressions in the Expression Editor panel — the debugging tool most often used during development.
The Set node is the most basic and most frequently used tool for reshaping data. There are two main modes: Manual Mapping to define fields one by one, and JSON Output to output a complete JSON structure in one go.
{
"customer_id": "C-1001",
"full_name": "Budi Santoso",
"email": "budi@example.com",
"is_premium": true,
"signup_date": "2026-08-01"
}A common pattern: take data from the incoming item, then restructure it into the format the next node expects. For example, the users/{id} API output has name and last_name fields, and you combine them into full_name to send to a database. Because n8n follows the principle of many small nodes, Set is often inserted between transformations to tidy data step by step.
Besides Set, there's Remove Duplicates to clean up duplicate data and Item Lists to aggregate or split items — their combination makes the "clean then shape" stage very expressive.
Not all workflows are straight lines. Sometimes two branches run in parallel and their results must be joined. This is where the Merge node comes in with several modes:
A practical example: the left branch fetches customer data from the database, the right branch fetches transaction history from an API. With Combine mode and the customer_id key, you get one item per customer complete with their transactions — ready for reporting.
When data consists of hundreds or thousands of items, processing them all at once is risky: the target API might refuse due to rate limits, or the process becomes slow. The SplitInBatches node splits a collection of items into small chunks, processes each batch, then continues to the next batch.
The flow: items enter SplitInBatches → process one batch (e.g. 10 items) → proceed to the storage node → return to SplitInBatches via the loop path for the next batch → finish when all items are exhausted. This is one of the most essential loop patterns in n8n, and you'll use it constantly for bulk work like data synchronization or mass sending.
Batch ke-1: item 1-25 -> simpan
Batch ke-2: item 26-50 -> simpan
...
Batch ke-40: item 976-1.000 -> simpanThe Loop Over Items node is also available for more explicit iteration when you need to control each item separately, for example when every item requires its own HTTP request. Choose SplitInBatches for throughput, Loop Over Items for per-item control.
If the built-in nodes aren't flexible enough, the Function node lets you write JavaScript directly in the workflow. The function receives an array of items, and you return a new array as the transformation result.
const hasil = items.map((item) => {
const nama = item.json.nama;
const potongan = nama.split(" ");
return {
json: {
...item.json,
nama_depan: potongan[0],
nama_belakang: potongan.slice(1).join(" "),
},
};
});
return hasil;Note: every result element must have a json key. If you want to include binary data, also add a binary key to the same item. For logic friendlier to casual writers, there's also the Code node with modern syntax and inline preview. Use Function for small, clear transformations; use Code when you need larger code structures or async.
Real data is rarely uniform — it needs branching. The IF node evaluates one or more conditions then routes items to the true or false output. Example: send promotional emails only to premium customers, the rest go to another path.
IF — simple binary branching, combined with AND/OR for compound conditions.Switch — multi-branch routing based on a value, great for categories like order status.Loop Over Items — explicit per-item iteration with an option to stop the loop.Limit — trims the number of items, useful for sampling or load protection.[
{ "name": "Budi", "is_premium": true, "orders": 12 },
{ "name": "Sari", "is_premium": false, "orders": 2 },
{ "name": "Dewi", "is_premium": true, "orders": 7 }
]With an IF node testing the is_premium field, two items go to the true branch and one to the false branch. Combine this technique with SplitInBatches, and you already have the foundation for building batch workflows that can filter and send at the same time.
This episode gave you a complete map of data in n8n: items structured with json and binary, the Set node to shape data, Merge to combine streams, SplitInBatches for bulk processing, Function for free-form logic, as well as IF, Switch, and Loop Over Items for conditionals and iteration. It's this combination of nodes that turns n8n from a mere API connector into a data transformation engine.
Key takeaways:
json and binary keys, and every item tracks its original item.Set is the first tool for tidying data structure before the next node.Merge combines parallel branches with append, combine, or position modes.SplitInBatches is the main loop pattern for rate-limit-friendly bulk work.Function and Code give you full freedom to write JavaScript transformations.In the next episode we'll make your workflows bulletproof — we'll break down error handling & workflow reliability: error workflows, retry, continue on fail, and alerting strategies so your automations don't silently die in the middle of the night. See you there!