Nested JSON Long-Format Path Table with Type and Depth Routing
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.Manual Trigger starts the run with one empty item.
- 2.Sample Nested Payloads emits two fictional payloads with nested objects, arrays, null and blank values.
- 3.Flatten To Path Rows recursively emits one row per terminal path with path, key, value, type, depth and parent index.
- 4.First If sends array paths to Merge input 1.
- 5.Second If sends empty/null rows to Merge input 2 and usable scalars to Merge input 3.
- 6.Merge (append, 3 inputs) collects all branches.
- 7.Final Code node (runOnceForAllItems) sorts rows and builds one report with counters, max depth and sum check.
- 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
- Import the JSON, open the workflow and click Execute Workflow.
- Confirm Flatten To Path Rows outputs 13 rows for the two payloads.
- Check the final report: totalRows=13, branchTotalMatchesRows=true, maxDepth=2.
- Edge case: add a payload with null or whitespace-only strings and verify emptyRows grows.
- 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
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (9)
Manual Trigger
Manual Trigger
Sample Nested Payloads
Code
Flatten To Path Rows
Code
Is Array Path?
If
Is Empty Or Null?
If
Merge Branch Rows
Merge
Build Long Table Report
Code
Tag Report Metadata
Set
Report Ready
No Op
Note Stages
Sticky Note
Note Routing
Sticky Note
Note Report
Sticky Note
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