Skip to content
Data & Databases

Orphan Field Reference Checker for Merged JSON Batches

9 nodes 66 4 Manual trigger
Download

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. 1.Manual Trigger fires with an empty item
  2. 2.Emit Merged Sample Batch produces the demo payload: four merged items and six reference paths
  3. 3.Scan Field References resolves each dotted path per item and emits one status record per reference
  4. 4.Normalize Reference Record adds referenceLabel and pathDepth while keeping all other fields
  5. 5.Is Reference Broken routes broken references to output 0 and healthy ones to output 1
  6. 6.Separate NoOp nodes feed Merge append input 0 and input 1
  7. 7.Build Orphan Reference Report aggregates all records into a single report item
  8. 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

  1. Import the JSON and click Execute Workflow
  2. Confirm the report shows 6 references, 2 healthy, 4 broken
  3. Check missingIndexes: customer.email missing at 1, totals.net at 2, source at 3, customer.phone in all items
  4. Happy path: add the missing fields to every item, brokenCount becomes 0 and safeToBuildExpressions true
  5. Edge case: set mergedItems or references to an empty array and verify a safe report with no error
  6. 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

Manual Trigger Code Set If No Op Merge

Details

Trigger Manual trigger
Nodes 9
Apps 6
Views 66
Downloads 4

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

Emit Merged Sample Batch

Code

#2

Scan Field References

Code

#3

Normalize Reference Record

Set

#4

Is Reference Broken

If

#5

Broken Reference Path

No Op

#6

Healthy Reference Path

No Op

#7

Merge Reference Reports

Merge

#8

Build Orphan Reference Report

Code

#9

Sticky Setup

Sticky Note

#10

Sticky Scan

Sticky Note

#11

Sticky 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