Orphan Field Reference Checker for Merged JSON Batches
Loading workflow…
Workflow Description
A self-contained checker that validates a merged batch before you build $json expressions on it. A Code node receives one item holding merged objects plus a list of dotted field paths, resolves each path with hasOwnProperty on every item, and emits one record per reference with present/missing counts, the indexes of items where the path is absent, and empty-value indexes. A Set node adds the expression label and path depth, IF splits healthy from broken, Merge (append) rejoins both branches, and a final Code node aggregates exactly one report item counting checked, healthy and broken references. No credentials, no network calls.
How it works
- 1.Manual Trigger fires with an empty item
- 2.Emit Merged Sample Batch produces the demo payload: four merged items and six reference paths
- 3.Scan Field References resolves each dotted path per item and emits one status record per reference
- 4.Normalize Reference Record adds referenceLabel and pathDepth while keeping all other fields
- 5.Is Reference Broken routes broken references to output 0 and healthy ones to output 1
- 6.Separate NoOp nodes feed Merge append input 0 and input 1
- 7.Build Orphan Reference Report aggregates all records into a single report item
- 8.Three sticky notes document input, scan and report stages
Use cases
- Audit merged output before writing downstream $json expressions
- Detect fields present in only some merged items to prevent silent empty values
- Compare schema compatibility of two sources joined by Merge
- Document broken paths for an automation team
Requirements
- n8n 2.45.7 or newer
- Only manualTrigger, code, set, if, merge, noOp and stickyNote nodes
- No credentials and no network access
- For real input: one item containing mergedItems and references
Setup and testing in n8n
- Import the JSON and click Execute Workflow
- Confirm the report shows 6 references, 2 healthy, 4 broken
- Check missingIndexes: customer.email missing at 1, totals.net at 2, source at 3, customer.phone in all items
- Happy path: add the missing fields to every item, brokenCount becomes 0 and safeToBuildExpressions true
- Edge case: set mergedItems or references to an empty array and verify a safe report with no error
- Empty-value case: the blank orderId appears in emptyValueWarnings, not as broken
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
Emit Merged Sample Batch
Code
Scan Field References
Code
Normalize Reference Record
Set
Is Reference Broken
If
Broken Reference Path
No Op
Healthy Reference Path
No Op
Merge Reference Reports
Merge
Build Orphan Reference Report
Code
Sticky Setup
Sticky Note
Sticky Scan
Sticky Note
Sticky 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