Skip to content
Data & Databases

Nested JSON Long-Format Path Table with Type and Depth Routing

9 nodes 54 2 Manual trigger
Download

Loading workflow…

Workflow Description

A fully local workflow that converts heterogeneous JSON payloads into a long-format table. A Code node recursively walks every incoming record and emits one row per terminal path carrying dot-notation path, last key, value, type, depth, array length, parent item index and record id. Two If nodes route each row into exactly one branch: arrays needing a later split, empty/null values, and directly usable scalars, each feeding its own Merge input in append mode. A final Code node aggregates all rows into a single report with per-type and per-branch counters, max depth and an integrity flag, then Set tags it and NoOp is the handoff point.

How it works

  1. 1.Manual Trigger starts the run with one empty item.
  2. 2.Sample Nested Payloads emits two fictional payloads with nested objects, arrays, null and blank values.
  3. 3.Flatten To Path Rows recursively emits one row per terminal path with path, key, value, type, depth and parent index.
  4. 4.First If sends array paths to Merge input 1.
  5. 5.Second If sends empty/null rows to Merge input 2 and usable scalars to Merge input 3.
  6. 6.Merge (append, 3 inputs) collects all branches.
  7. 7.Final Code node (runOnceForAllItems) sorts rows and builds one report with counters, max depth and sum check.
  8. 8.Set adds reportType and schemaVersion keeping other fields; NoOp is the delivery point.

Use cases

  • Flattening irregular webhook payloads before reporting
  • Identifying which paths later need a Split Out node
  • Spotting empty or null fields in inbound records
  • Documenting an unknown payload schema before mapping

Requirements

  • n8n 2.48.4 with manualTrigger, code, if, merge, set, noOp, stickyNote
  • No credentials or external calls required
  • For real data: replace the sample Code node with a source emitting JSON items of the same shape

Setup and testing in n8n

  1. Import the JSON, open the workflow and click Execute Workflow.
  2. Confirm Flatten To Path Rows outputs 13 rows for the two payloads.
  3. Check the final report: totalRows=13, branchTotalMatchesRows=true, maxDepth=2.
  4. Edge case: add a payload with null or whitespace-only strings and verify emptyRows grows.
  5. Edge case: make the sample node return [] and confirm the report returns zeros without error.

Service Value

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

Apps Used

Manual Trigger Code If Merge Set No Op

Details

Trigger Manual trigger
Nodes 9
Apps 6
Views 54
Downloads 2

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 (9)

/

Manual Trigger

Manual Trigger

#1

Sample Nested Payloads

Code

#2

Flatten To Path Rows

Code

#3

Is Array Path?

If

#4

Is Empty Or Null?

If

#5

Merge Branch Rows

Merge

#6

Build Long Table Report

Code

#7

Tag Report Metadata

Set

#8

Report Ready

No Op

#9

Note Stages

Sticky Note

#10

Note Routing

Sticky Note

#11

Note Report

Sticky Note

#12
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