Array (data structure)
An ordered list of items in JSON data. Most API responses return arrays e.g., a list of contacts, a list of orders. Workflow loops iterate over arrays to process each item individually.
Expert insight
A workflow step that assumes an array will always have at least one item breaks the first time an upstream system returns an empty result set, a common occurrence (no new records today, a search with zero matches) that's easy to forget to handle explicitly during initial testing with non-empty sample data.
In a real workflow
An order’s line items arrive as an array; the workflow loops over it to update stock for each product.
Common mistakes
- Assuming an array always has at least one item.
- Treating a single object and an array of one the same way.
Complexity level
Requires some familiarity with automation concepts.
Related terms
JSON (JavaScript Object Notation)
The universal data format for APIs and webhooks. When Stripe sends a payment eve…
Loop / iterator
A workflow pattern that processes a list of items one by one. Example: for each …
Data transformation
Modifying data as it flows through an automation reformatting dates, concatenati…
See it in action
Want Array (data structure) built into your automation?
Book a free audit and we'll show you exactly how this applies to your business.
Get my free automation plan →Who we build for
Run a firm, an agency or an online store? We automate the work behind it.
Done-for-you n8n workflows and Claude AI agents, fixed price, maintained for you.
- Professional firms Onboarding, documents, billing and reporting run on their own. See what we automate →
- Agencies and SaaS teams Custom n8n and Claude builds, client reporting and internal tools. See what we automate →
- E-commerce brands Orders, support, returns and stock handled without the busywork. See what we automate →
More in Data
Keep exploring
Backfill
Retroactively processing historical data through a new automation afte…
Change data capture (CDC)
A technique that tracks database changes in real-time and triggers aut…
Data enrichment
Augmenting existing records with additional data from external sources…
Data pipeline
A sequence of data processing steps that move and transform data from …
Data quality
The accuracy, completeness, and consistency of data flowing through au…
ETL (Extract, Transform, Load)
A three-phase data pipeline pattern: extract raw data from source syst…
Go deeper
Guides that cover Array
n8n Code Node: 15 JavaScript Examples You Can Copy and Paste
Fifteen n8n Code node snippets that work as pasted: the return format n8n expects, looping over items, filtering, splitting arrays, reading earlier nodes, dates with Luxon and more.
n8n Code Node With Multiple Inputs: 3 Methods That Work
The Code node only has one input connector. Three reliable ways to work with two or more data sources anyway, with code you can paste and the trap that breaks each one.
n8n Code Node Errors Fixed: "Code doesn't return items properly" and More
Five Code node errors cover most of the questions on the n8n forum. Each one with the exact cause, a before and after snippet, and the check that prevents it.