← Lesson
BitWithBite
n8n Automation · Quick Reference

Lesson 6: Working with Data & JSON Cheat Sheet

n8n Automation
In one line: N8N passes data between nodes as a structured array of items. Learn to add fields with the Set node, run custom JavaScript with the Code node, and combine data streams with the ...

Key Ideas

1📝 N8N's Data Structure — The Items Array. Everything in N8N flows as an array of items. Each item is a JavaScript object with a json property containing your data. Understanding this structure is the foundatio...
2⚙️ The Set Node — Add & Modify Fields. The Set node is your primary tool for adding new fields, renaming existing ones, removing fields, and reshaping your data structure. It's a no-code field mapper — you ...
3💻 The Code Node — Custom JavaScript. When the Set node isn't powerful enough, reach for the Code node. It gives you a full JavaScript environment to transform items with any logic you need — map, filter, ...
4🤝 Merge Node — Combining Data Streams. When your workflow splits into multiple branches (from an IF node, Switch node, or parallel API calls), the Merge node brings them back together. Choose the merge stra...
5🔄 Data Transformation Flow. A typical data pipeline in N8N flows data through a series of transformations before writing it to a destination. Here's the full picture:

Code Examples

// This is how N8N passes data between nodes [ { "json": { "name": "Alice", "email": "alice@example.com", "role": "admin" } }, { "json": { "name": "Bob", "email": "bob@example.com", "role...
// Combine two string fields fullName = {{ $json.firstName + ' ' + $json.lastName }} // Normalize email to lowercase email = {{ $json.email.toLowerCase() }} // Extract year from date string year = {{ new Date($json.createdAt).getFullYear() }} //...
// Transform all items flowing through this node return items.map(item => ({ json: { // Combine first + last name fullName: item.json.firstName + ' ' + item.json.lastName, // Normalize email to lowercase email: item.json.email.t...