Recursive Nested JSON Key Rename with Preserved-Keys Manifest
Loading workflow…
Workflow Description
A fully local workflow: a manual trigger feeds a fictional 3-level nested sample, a Code node recursively applies an editable rename dictionary at every depth while preserving unmapped keys and building a path manifest of renamed vs preserved keys. The algorithm detects name collisions (target key already exists) and never silently overwrites values — collisions are recorded instead. An If node compares total key counts before and after (17/17) to detect silent loss, and a Set node appends a readable report retaining all fields.
How it works
- 1.Run the manual trigger to emit the fictional nested sample
- 2.Rename Engine applies the dictionary recursively over objects and arrays
- 3.The engine collects a manifest of renamed, preserved and conflicting key paths
- 4.If compares original vs new total key counts and routes true or false
- 5.Set adds a text report keeping all other fields; a sticky note documents the dictionary
Use cases
- Normalizing hierarchical API responses before storage
- Renaming integration field names without data loss
- Auditing schema transformations with a reviewable manifest
Requirements
- No credentials; all processing is local
- For real input remove the sample node and feed same-schema data into Rename Engine
- Edit RENAME_MAP inside the Rename Engine Code node
Setup and testing in n8n
- Import the workflow in n8n and click Execute Workflow
- Verify the manifest and the 17/17 key count (7 renamed, 10 preserved) on the true branch
- Replace the sample value with a string or null to see the invalid item routed to Flag Silent Loss
- Add a pre-existing 'town' key to the sample to prove collision detection in manifest.conflicts without silent overwrite
- Add a dictionary entry and rerun to confirm renaming at all levels
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 (6)
Manual Trigger
Manual Trigger
Load Fictional Sample
Code
Rename Engine
Code
Key Counts Match
If
Format Final Report
Set
Flag Silent Loss
Set
Dictionary & Setup Guide
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