Special-Character JSON Payload Round-Trip Verification Harness
Loading workflow…
Workflow Description
A fully local workflow proving that text containing $&, quotes and backslashes survives payload construction, serialization and parsing. A Manual Trigger starts a Code node that emits fictional test records; a second Code node builds the payload as a real JavaScript object, deliberately avoiding Set JSON mode, and can simulate the reported broken escaping. A verification Code node performs JSON.stringify, JSON.parse and a character-by-character comparison, reporting the first break index with its Unicode code point. Set adds a summary, IF splits intact from corrupted, Merge appends both branches on separate inputs and a NoOp emits the unified report.
How it works
- 1.Manual Trigger fires one empty item
- 2.Code node emits four fictional records with $&, quotes, backslashes and one missing-text row
- 3.Code node builds the payload object programmatically and lists the special characters present
- 4.Second Code node stringifies, parses and diffs original vs rebuilt text character by character
- 5.Set adds summary and harness fields while keeping all other fields
- 6.IF routes isIntact true to the intact branch and false to the corrupted branch
- 7.Merge in append mode collects both branches on separate inputs
- 8.NoOp outputs the unified verification report
Use cases
- Validating dynamically built payloads from free-text user input
- Pinpointing where special characters get mangled in incoming data
- Local regression testing of JSON building logic inside n8n
Requirements
- n8n 2.47.5 with Code, Set, IF, Merge, NoOp and Sticky Note nodes
- No credentials and no network access needed
- Input schema: recordId, text, optional simulateLegacyJsonMode
Setup and testing in n8n
- Import the JSON and click Execute Workflow
- Confirm three intact reports and one corrupted report for REC-003 at index 20
- Add more special characters to REC-001 and confirm it stays intact
- Set simulateLegacyJsonMode true on another record and confirm the break index is reported
- Remove the text field from a record to confirm missing values become an empty string
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
Fictional Sample Records
Code
Build Payload In Code
Code
Round-Trip Verify
Code
Shape Report Fields
Set
Is Payload Intact?
If
Intact Payloads
No Op
Corrupted Payloads
No Op
Merge Verification Reports
Merge
Unified Verification Output
No Op
Note Setup
Sticky Note
Note Core Logic
Sticky Note
Note Routing
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