JSON Payload Prep Gate: Dotted-Key Neutralization and Unicode Escaping with Reversible Changelog
Loading workflow…
Workflow Description
A fully local workflow that prepares payloads before a Set node in JSON mode. A Code node walks the structure recursively, renames every key containing a dot or brackets into a safe form while recording a restore map, escapes unsafe characters in string values into \uXXXX sequences, then runs the inverse transform and deep-compares it with the original. A Set node flags readiness while keeping all fields, an If node separates sanitized from already-clean items, Merge rejoins both branches, and a final Code node emits one changelog report with per-item rename and escape counters plus warnings.
How it works
- 1.Manual Trigger starts the run
- 2.Load Sample Payloads emits four fictional items: dotted key with emoji, clean record, nested dotted keys with accented/emoji text, and an empty object
- 3.Sanitize node renames unsafe keys, builds restoreMap and escapes characters to \uXXXX
- 4.The same node un-escapes, re-applies original keys and deep-compares to set reversibleMatch
- 5.Set node adds readyForSetJson and sanitizerVersion with includeOtherFields:true
- 6.If node routes sanitized items to output 1 and clean items to output 2
- 7.Merge (append, 2 inputs) rejoins both branches, NoOp acts as checkpoint
- 8.Final Code node (runOnceForAllItems) returns one changelog report
Use cases
- Preparing emoji-bearing user text for dynamic JSON templates in n8n
- Preventing silent value loss when a JSON key contains a dot in Set JSON mode
- Auditing encoding reversibility before handing a payload downstream
- Producing a data-quality changelog
Requirements
- n8n 2.48.4 or newer
- No credentials required: all processing is local
- Replace the sample node with your real source using the same shape (one JSON object per item)
Setup and testing in n8n
- Import the JSON and open the workflow
- Click Execute Workflow and inspect the Sanitize output: item 0 must contain order__DOT__customer__DOT__name with value Lina \u26D4
- Confirm reversibleMatch is true for every item
- Check the final report: totalItems=4, sanitizedItemCount=2, cleanItemCount=2
- Edge case: the empty object appears on the clean branch with zero counters and a warning
- Change a sample key to data[0].id and verify renaming and restoration
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 (8)
Manual Trigger
Manual Trigger
Load Sample Payloads
Code
Sanitize Keys And Unicode
Code
Mark Ready For Set JSON
Set
Was Sanitized?
If
Merge Branches
Merge
Audit Checkpoint
No Op
Build Changelog Report
Code
Sticky Stage Overview
Sticky Note
Sticky Encoding Rules
Sticky Note
Sticky Output Notes
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