Skip to content
AI Agents

Subarray Key Labelled Rows Report Builder

11 nodes 7 0 Manual trigger
Download

Read the execution path horizontally, with supporting AI nodes below. Layout changes affect this preview only; the download stays unchanged.

Loading workflow…

Workflow Description

A manual-trigger workflow loads a fictional object with two named subarrays (2 invoices, 3 shipments) plus edge fields (empty array, non-array value). A Code node flattens every array element into a row labelled by the array key, keeping the element's own values unmixed. A Set node orders report columns, a parallel Code node sums subarray lengths, and an IF node compares it to the row count, routing mismatches to a deviation report naming both numbers before one final aggregated report.

How it works

  1. 1.Run the manual trigger to emit the fictional sample object with named subarrays and edge-case fields
  2. 2.A Code node scans object keys and emits one row per array element with label, position and original values
  3. 3.A Set node orders label, position and source_values while retaining other fields
  4. 4.A parallel Code node sums subarray lengths and merges with the rows
  5. 5.An IF node compares counts: match passes through NoOp, mismatch builds a deviation report naming both numbers
  6. 6.A final Code node aggregates everything into a single report item

Use cases

  • Flattening JSON objects with named subarrays into one labelled report table
  • Auditing split integrity by comparing row count to summed array lengths
  • Preparing source-labelled rows for downstream analysis or export

Requirements

  • n8n version 2.44.4
  • No external credentials and no network calls
  • Replace the sample object inside the loader Code node with real data of the same schema for production use

Setup and testing in n8n

  1. Import into n8n 2.44.4, execute manually, expect one report with status ok and five rows
  2. Verify labels_present equals exactly invoices and shipments
  3. Edge test: empty an array or force a count mismatch and expect a deviation report naming both numbers
  4. A valid empty source produces an ok report with zero rows; an invalid source produces a deviation report with the reason. Verify unique source positions.

Service Value

Ready-made workflow template for automation delivery and service execution.

Apps Used

Manual Trigger Code Set Merge If No Op

Details

Trigger Manual trigger
Nodes 11
Apps 6
Views 7
Downloads 0

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (11)

/

Run Manual Demo

Manual Trigger

#1

Load Sample Source Object

Code

#2

Flatten Subarrays Into Labelled Rows

Code

#3

Order Report Columns

Set

#4

Sum Subarray Lengths

Code

#5

Merge Rows With Expected Count

Merge

#6

Verify Row Integrity

Code

#7

Counts Match

If

#8

Integrity Confirmed

No Op

#9

Build Deviation Report

Code

#10

Build Final Report

Code

#11

Sticky Setup

Sticky Note

#12

Sticky Derivation Rule

Sticky Note

#13

Sticky Verification

Sticky Note

#14
Stay in the loop

Fresh workflows, straight to your inbox

Get newly published DROPIDEA workflows, a clear overview of what they do, and a link to explore them.

  • New workflows
  • Clear overviews
  • Setup guides

Be first to discover what is new

Your name, your email, and one confirmation.

Email confirmation · Unsubscribe anytime