Function

Aggregate Multiple JSON Items into a Single Array

Automate JSON aggregation with n8n's Function node to transform scattered records into structured arrays, streamlining API integrations and boosting data processing efficiency.

Function
Manual Trigger

This workflow demonstrates how to collect and aggregate multiple individual JSON objects into a single array, nested within a single output item. The initial "Mock Data" node serves as a data source, generating three separate n8n items, each containing a distinct JSON object with `id` and `name` properties. This simulates a common scenario where data arrives as individual records. The subsequent "Create an array of objects" Function node then processes these incoming items. It iterates through each item, extracts its core JSON data, and consolidates them into a new, single array. This array is then assigned to a property named `data_object` within a *single* final JSON output item. This pattern is highly useful for preparing data to be sent to APIs or services that expect an array of objects in a single payload, effectively transforming a stream of individual records into a batch-ready structure.

2
Nodes
1
Services
2
Categories
Manual
Type

Get This Workflow

Free n8n workflow template ready to import

Share on social

📄 File Details

1125_Create.json
Create
09/04/2025
Ready to Import

Just upload and configure

🔧
Production Ready

Tested and optimized

📚
Documentation

Complete setup guide

Automate JSON aggregation with n8n's Function node to transform scattered records into structured arrays, streamlining API integrations and boosting data processing efficiency.

Loading visualization...
Loading target audience...
Loading security notes...
Loading compatibility...

Services & Integrations

Function
Loading FAQ...

How to Use This Workflow

1

Download the Workflow

Click the "Download Workflow" button above to get the JSON file.

2

Import to n8n

In your n8n instance, go to Workflows → Import and select the JSON file.

3

Configure Credentials

Set up your Function and other service credentials in n8n.

4

Activate & Test

Activate the workflow and test it to ensure everything works correctly.

Tags

#create
#function
#manual
#create
#workflow-automation
Loading checklist...

Related Workflows

Ready to transform your business?