Reversible Dot-Path Encoder for Nested Objects with Round-Trip Proof
Loading workflow…
Workflow Description
A fully local workflow that converts nested objects into text lines of the form "dot.path = value" with a recursive Code node, joins them into a single string field with Set, then decodes them back, rebuilding objects and arrays according to each path segment, and compares the result with the original using a key-sorted canonical serialization. An If node routes matches to a verified path and mismatches to a failure path via NoOp, both merged in append mode, and a final Code node emits one report containing line counts, match totals, failure reasons and failed record ids.
How it works
- 1.Manual Trigger starts the run
- 2.Code node emits three demo records: two nested objects and one non-object payload
- 3.Code node encodes each payload into "$.path = value" lines using JSON.stringify for leaves and {} / [] for empties
- 4.Set node (includeOtherFields) builds textBlob by joining lines with newlines
- 5.Code node decodes the lines, rebuilds the tree and deep-compares it to the original
- 6.If node routes roundTripMatch=true to the verified branch, false to the failure branch
- 7.Two NoOp nodes feed Merge (append, 2 inputs)
- 8.Final Code node in runOnceForAllItems returns exactly one aggregated report
Use cases
- Passing nested objects through intermediate text fields without losing structure
- Verifying that a rebuilt structure matches the original before the next stage
- Diagnosing JSON parse errors caused by [object Object]
- Producing a per-run audit report of encoding quality
Requirements
- n8n 2.46.7 or newer
- No credentials and no external connectivity
- Input items shaped { recordId, payload } to replace the demo data
Setup and testing in n8n
- Import the JSON and open the workflow
- Click Execute Workflow
- Inspect the encoder output: no [object Object] string appears
- Inspect the final report: 3 records, 2 matched, 1 failed (REC-003)
- Add a record with nulls and empty arrays and confirm it still matches
- Add a non-object payload and confirm it appears in failedRecordIds
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 (10)
Manual Trigger
Manual Trigger
Load Sample Records
Code
Encode To Dot Paths
Code
Build Text Field
Set
Decode And Compare
Code
Round Trip Verified?
If
Verified Path
No Op
Failed Path
No Op
Merge Branches
Merge
Build Round Trip Report
Code
Note Encoding Stage
Sticky Note
Note Decode And Proof
Sticky Note
Note Routing And Report
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