[items array: {json:obj}, {json:obj}, {json:obj}]
[items array: [ json array: {obj}, {obj}, {obj} ] ]
Each n8n node runs its operations on in the array
each item
So in the first data structure it operates 3 times on {json:obj}
But in the second data structure it operates just once on the json array.
When you have the second type of data structure, you need to:
First unbundle the json array into items
Then run operations on each individual item.
To do this, use a function node:
return items[0].json.map( item => ( { json : item } ));
Sometimes (e.g. with external APIs returning data in a different format), you will encounter nested items. This usually means the data we are interested in is its own object nested within the JSON response from the API.
Where "results" is the object/array of interest, we would modify our function above as so:
return items[0].json.results.map(item => ( { json : item } ));