Skip to content
AI Agents

Dotted Key Normalizer with Collision Detection and Literal Round-Trip Verification

10 nodes 72 6 Manual trigger
Download

Loading workflow…

Workflow Description

A manual-trigger workflow generates two fictional nested payloads, then a Code node recursively scans objects and arrays replacing dots in keys with spaces at every level while logging each rename with its exact location, detects any collision between two produced key names in the same object before writing, discards the modified copy and records both original paths. A second Code node reverses only the logged renames, so the original structure is restored literally even when keys contain original spaces, then compares literally with the original. A Set node adds stage markers, an IF node routes matched items to success and the rest to failure without stopping execution, and a final Code node emits one summary report per run with no network calls.

How it works

  1. 1.Run the manual trigger; the sample node emits a valid nested item with dotted keys and arrays plus an intentional collision item (a.b with a b)
  2. 2.The normalizer scans all levels, replaces dots with spaces, logs each rename with its path, records colliding paths and discards the modified copy of colliding items
  3. 3.The verification node reverses only the rename log, compares JSON.stringify literally with the original and emits the match result
  4. 4.A Set node adds stage fields with includeOtherFields:true, then the IF node routes matched items to success and mismatched/colliding items to failure without stopping the workflow
  5. 5.Merge collects both branches into separate inputs and a final Code node emits one report with counts and per-item detail

Use cases

  • Normalizing dotted JSON keys from external systems before stages requiring simple names
  • Safely converting dot notation to spaces inside deep structures with arrays and nested objects
  • Detecting silent field merging when two keys produce the same resulting key

Requirements

  • n8n 2.44.6 with manual trigger, code, set, if, merge, noOp and stickyNote nodes
  • No credentials or network calls; the dot-to-space map and location-based rename log are embedded in code
  • For real data replace the sample payload node with a Webhook or HTTP Request node using the same {payload:{...}} schema

Setup and testing in n8n

  1. Import the JSON in n8n and execute the Manual Trigger node
  2. Expect one final report: 2 items, 1 normalized, 1 collision with paths payload.a.b and payload.a b, 1 verified match, allPassed=false
  3. For a fully valid case delete the second sample item and confirm allPassed=true and verifiedMatches=1
  4. Add a key containing an original space with no dotted equivalent and confirm the round trip still matches literally because reversal uses the rename log

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 10
Apps 6
Views 72
Downloads 6

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

/

Manual Trigger

Manual Trigger

#1

Fictional Sample Payload

Code

#2

Normalize Dotted Keys

Code

#3

Round-Trip Verification

Code

#4

Enrich Verification Record

Set

#5

Matched?

If

#6

Success Path

No Op

#7

Failure Path

No Op

#8

Collect Results

Merge

#9

Final Summary Report

Code

#10

Mapping Documentation

Sticky Note

#11

Flow Documentation

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