Skip to content
Data & Databases

Reversible Dot-Path Encoder for Nested Objects with Round-Trip Proof

10 nodes 12 0 Manual trigger
Download

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. 1.Manual Trigger starts the run
  2. 2.Code node emits three demo records: two nested objects and one non-object payload
  3. 3.Code node encodes each payload into "$.path = value" lines using JSON.stringify for leaves and {} / [] for empties
  4. 4.Set node (includeOtherFields) builds textBlob by joining lines with newlines
  5. 5.Code node decodes the lines, rebuilds the tree and deep-compares it to the original
  6. 6.If node routes roundTripMatch=true to the verified branch, false to the failure branch
  7. 7.Two NoOp nodes feed Merge (append, 2 inputs)
  8. 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

  1. Import the JSON and open the workflow
  2. Click Execute Workflow
  3. Inspect the encoder output: no [object Object] string appears
  4. Inspect the final report: 3 records, 2 matched, 1 failed (REC-003)
  5. Add a record with nulls and empty arrays and confirm it still matches
  6. 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

Manual Trigger Code Set If No Op Merge

Details

Trigger Manual trigger
Nodes 10
Apps 6
Views 12
Downloads 0

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

Load Sample Records

Code

#2

Encode To Dot Paths

Code

#3

Build Text Field

Set

#4

Decode And Compare

Code

#5

Round Trip Verified?

If

#6

Verified Path

No Op

#7

Failed Path

No Op

#8

Merge Branches

Merge

#9

Build Round Trip Report

Code

#10

Note Encoding Stage

Sticky Note

#11

Note Decode And Proof

Sticky Note

#12

Note Routing And Report

Sticky Note

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