Convert Array to Array of Objects in n8n

Transform a single array item into multiple object items using n8n's Function node for efficient data restructuring.

n8n
Convert Array to Array of Objects in n8n

This workflow showcases a simple yet powerful technique to convert a flat array within a single n8n item into an array of individual objects. Starting with mock data containing an array like ['item-1', 'item-2'], the Function node maps over it, producing separate items each with a structured object {data: 'item-X'}. This is ideal for workflows where incoming data arrives as a nested array but needs to be processed item-by-item by downstream nodes.

The primary benefit is flexibility in data manipulation: unlike standard nodes, the Function node allows custom JavaScript to alter the number of output items, enabling splitting, aggregating, or transforming data dynamically. It saves time by avoiding complex expressions or multiple nodes, making it efficient for developers handling API responses or CSV imports.

Use cases include preparing list data from webhooks (e.g., GitHub issues or email lists) for looping operations, normalizing JSON arrays for database inserts, or chaining to tools like Split In Batches. In enterprise settings, it's valuable for ETL processes in IT/development pipelines, ensuring data flows seamlessly without manual scripting outside n8n.

Customization is straightforward: replace mock data with real inputs and adapt the JS code for your schema, such as adding keys or filtering items.

$4.99
Last updated August 29, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related Enterprise workflows

More from Saskia Kowalczyk

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.