Skip to content
Data & Databases

Single Target Key Ambiguity Adjudicator for Heterogeneous JSON

11 nodes 44 3 Manual trigger
Download

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. 1.Manual Trigger starts the run and emits a single empty item.
  2. 2.Code node emits five sample records: single path, two conflicting paths, missing key, two identical-value paths, blank id.
  3. 3.Code node recursively traverses each record and collects dotted paths including array indexes, then counts distinct values.
  4. 4.Classification is assigned: confirmed with value and path, ambiguous with all paths and values, or missing.
  5. 5.First IF separates confirmed; second IF separates ambiguous from missing.
  6. 6.NoOp node holds ambiguous records for review before tagging.
  7. 7.Set nodes with includeOtherFields add branch and reviewStatus without dropping fields.
  8. 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

  1. Import the JSON into n8n and click Execute Workflow.
  2. Inspect the traversal node output: confirmed, ambiguous and missing must all appear.
  3. Verify the NoOp node receives only record R-2.
  4. Check the final report: totalRecords=5, confirmedCount=2, ambiguousCount=1, missingCount=2, integrityCheck=true.
  5. Edge case: empty the sample array; a no-input record classified missing is returned.
  6. 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

Manual Trigger Code If Set No Op Merge

Details

Trigger Manual trigger
Nodes 11
Apps 6
Views 44
Downloads 3

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 (11)

/

Manual Trigger

Manual Trigger

#1

Emit Sample Webhook Payloads

Code

#2

Adjudicate Target Key Paths

Code

#3

Is Confirmed?

If

#4

Tag Confirmed

Set

#5

Is Ambiguous?

If

#6

Hold Ambiguous For Review

No Op

#7

Tag Ambiguous

Set

#8

Tag Missing

Set

#9

Merge Classified Records

Merge

#10

Build Classification Report

Code

#11

Sticky Classification Rules

Sticky Note

#12

Sticky Routing And Report

Sticky Note

#13

Sticky Setup

Sticky Note

#14
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