Single Target Key Ambiguity Adjudicator for Heterogeneous JSON
Loading workflow…
Workflow Description
A fully local workflow that solves the problem of a target key appearing at different paths across records. A Manual Trigger emits five fictional payloads, then a Code node recursively walks each record (objects and arrays, cycle-safe) collecting every path where the key occurs along with its value. One path, or several paths holding identical values, yields confirmed; conflicting values yield ambiguous; absence yields missing. Two IF nodes route the records, ambiguous ones pass through a NoOp review hold, a three-input Merge appends the branches, and a final Code node emits one classification report with counts, usable values and conflicting paths.
How it works
- 1.Manual Trigger starts the run and emits a single empty item.
- 2.Code node emits five sample records: single path, two conflicting paths, missing key, two identical-value paths, blank id.
- 3.Code node recursively traverses each record and collects dotted paths including array indexes, then counts distinct values.
- 4.Classification is assigned: confirmed with value and path, ambiguous with all paths and values, or missing.
- 5.First IF separates confirmed; second IF separates ambiguous from missing.
- 6.NoOp node holds ambiguous records for review before tagging.
- 7.Set nodes with includeOtherFields add branch and reviewStatus without dropping fields.
- 8.Merge (append, 3 inputs) collects branches and a single Code node outputs the final report.
Use cases
- Validate a customer id in heterogeneous webhook payloads before downstream use.
- Exclude records with conflicting values from automated processing.
- Audit the structural quality of JSON arriving from several source systems.
- Produce a manual review list for ambiguous records.
Requirements
- n8n 2.46.4 or compatible with the listed node versions.
- No credentials and no network access required.
- Edit the targetKey variable inside the traversal Code node.
- For real input: replace the sample node with a Webhook or HTTP Request node producing the same items.
Setup and testing in n8n
- Import the JSON into n8n and click Execute Workflow.
- Inspect the traversal node output: confirmed, ambiguous and missing must all appear.
- Verify the NoOp node receives only record R-2.
- Check the final report: totalRecords=5, confirmedCount=2, ambiguousCount=1, missingCount=2, integrityCheck=true.
- Edge case: empty the sample array; a no-input record classified missing is returned.
- Edge case: set targetKey to a nonexistent key; all records become missing.
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 (11)
Manual Trigger
Manual Trigger
Emit Sample Webhook Payloads
Code
Adjudicate Target Key Paths
Code
Is Confirmed?
If
Tag Confirmed
Set
Is Ambiguous?
If
Hold Ambiguous For Review
No Op
Tag Ambiguous
Set
Tag Missing
Set
Merge Classified Records
Merge
Build Classification Report
Code
Sticky Classification Rules
Sticky Note
Sticky Routing And Report
Sticky Note
Sticky Setup
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