Split JSON Array into Individual Items
detail.loadingPreview
This workflow efficiently transforms a single n8n item containing a nested JSON array into multiple individual n8n items. It's perfect for scenarios where you receive a list of data within a single payload and need to process each element separately.
About This Workflow
Many APIs and data sources return collections of data as a single JSON array embedded within a larger object. This n8n workflow provides a robust solution to "flatten" such structures, converting each element of the nested array into its own distinct n8n item. This crucial data transformation step allows subsequent nodes in your workflow to process each record independently, enabling powerful automations like sending personalized emails, updating individual database entries, or performing actions specific to each item in a list. It leverages the versatile Function node for precise data manipulation.
Key Features
- Converts Nested Arrays: Seamlessly transforms a single n8n item with a JSON array into multiple discrete items.
- Customizable Logic: Utilizes the flexible Function node, allowing for easy adaptation to various input data structures.
- Prepares Data for Processing: Essential step to ensure downstream nodes can operate on individual records, rather than a single bulk payload.
- Enhanced Workflow Control: Gain finer control over your data processing by breaking down complex lists into manageable individual units.
How To Use
- Input Data (Node: "Mock Data"): Replace the
functionCodein the "Mock Data" node (or your initial data source node) with your actual data structure. Ensure your array of objects is nested within ajsonproperty, similar to the mock example:return [{ json: [{id: 1, name: "Item A"}, {id: 2, name: "Item B"}] }]. - Split Items (Node: "Create JSON-items"): This
Functionnode is pre-configured to iterate through thejsonarray of the first input item (items[0].json) and transform each element into a new n8n item. No modification is typically needed here unless your nested array is under a different property name. - Connect to Downstream Nodes: Connect the "Create JSON-items" node to any subsequent nodes in your workflow. Each original element from your array will now be available as a separate item, ready for individual processing.
Apps Used
Workflow JSON
{
"id": "7d0c916c-36a8-46ad-8f46-ffcbb2501490",
"name": "Split JSON Array into Individual Items",
"nodes": 27,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 7d0c916c-36a8...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.
Automate Getty Images Editorial Search & CMS Integration
This n8n workflow automates searching for editorial images on Getty Images, extracts key details and embed codes, and prepares them for seamless integration into your Content Management System (CMS), streamlining your content creation process.