Nested JSON Structure Drift Diff Reporter
Loading workflow…
Workflow Description
A fully local n8n workflow that compares the structure of two nested JSON payloads (reference and new) with no external calls. A Code node emits three fictional comparison cases, then a recursive diff engine traverses objects and arrays at any depth, building dotted paths and classifying each difference as added key, removed key, or type change. An IF node routes structurally stable payloads (zero diffs) to a NoOp branch and drifted payloads to a Set node that records status and a review hint. Both branches merge into a final Code node that returns one aggregated report.
How it works
- 1.Manual Trigger starts execution with an empty item.
- 2.A Code node emits three fictional cases: deep drift, identical structure with different values, and a null new payload.
- 3.The diff Code node recursively walks both payloads and returns diffs plus added/removed/typeChanged counters per case.
- 4.An IF node checks whether diffCount equals zero.
- 5.True branch goes to a NoOp node for stable structures.
- 6.False branch goes to a Set node adding status and reviewHint while keeping other fields.
- 7.A Merge node (append, two inputs) joins both branches.
- 8.A final runOnceForAllItems Code node outputs a single report item sorted by caseId.
Use cases
- Detect API response schema drift before writing extraction expressions
- Verify webhook payload stability between releases
- Diagnose [object Object] or undefined expression results
- Document JSON schema changes during integration reviews
Requirements
- n8n 2.47.7 or newer
- No credentials or network access
- For production: a source emitting {caseId, oldPayload, newPayload}
Setup and testing in n8n
- Import the JSON and open the workflow.
- Click Execute Workflow.
- Open Build Single Drift Report and confirm one item with totalCases=3 and stableCases=1.
- Confirm CASE-A reports user.address.zip removed, user.email added, user.tags type_changed string→array.
- Confirm CASE-B has diffCount=0 and passed the NoOp branch.
- Edge case: change CASE-C newPayload to a string and confirm type_changed at path (root).
- Empty case: make the sample node return [] and confirm the NO_INPUT item.
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 (8)
Manual Trigger
Manual Trigger
Load Sample Payload Pairs
Code
Diff Nested Structures
Code
If Structure Identical
If
Stable Structure (No Action)
No Op
Document Structure Drift
Set
Merge Both Routes
Merge
Build Single Drift Report
Code
Note Input Stage
Sticky Note
Note Diff Logic
Sticky Note
Note Routing And 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