This workflow demonstrates how to transform a single n8n item that contains an array of JSON objects into multiple individual n8n items. The initial 'Mock Data' Function node simulates a common scenario where a preceding node might output data in a nested format, such as a list of records within one primary item. The subsequent 'Create JSON-items' Function node then processes this nested structure. It iterates through the array of JSON objects found within the 'json' property of the first incoming item. For each object in that array, it generates a new, separate n8n item, with the individual JSON object assigned to the 'json' property of the new item. This process effectively 'flattens' or 'unnests' the data, making each record accessible as an independent n8n item, which is often required for subsequent processing by other n8n nodes. This pattern is useful when an API or data source returns a collection of data as a single payload, and you need to process each element of that collection independently.
Free n8n workflow template ready to import
Official n8n visualization • Click and drag to explore
Loading workflow visualization...
Click the "Download Workflow" button above to get the JSON file.
In your n8n instance, go to Workflows → Import and select the JSON file.
Set up your Function and other service credentials in n8n.
Activate the workflow and test it to ensure everything works correctly.
Get a custom n8n workflow built specifically for your business needs.
Ready to transform your business?