Special Character JSON Escape Behavior Reference Matrix
Loading workflow…
Workflow Description
A fully local diagnostic workflow. A Manual Trigger starts a Code node that generates seven test values containing documented problem characters: double quote, backslash, $&, single quote, newline/tab, nested JSON text and a non-string edge case. Each value is placed into an object programmatically, serialized with JSON.stringify, parsed back with JSON.parse inside try/catch and compared literally with the original. An IF node splits survivors from distorted rows, two Set nodes add a verdict while keeping all other fields, a Merge in append mode joins both branches, and one aggregating Code node emits a single matrix report with match and parse-failure counts.
How it works
- 1.Manual Trigger emits one empty item
- 2.Code node builds special-character cases and runs stringify/parse roundtrip in try/catch with literal comparison
- 3.IF node routes matched=true to the clean path and matched=false to the distortion path
- 4.First Set node adds verdict=survived with includeOtherFields
- 5.Second Set node adds verdict=distorted with includeOtherFields
- 6.NoOp node documents the clean path
- 7.Merge (append, 2 inputs) collects all rows
- 8.Aggregating Code node returns exactly one item with stats and a deduplicated sorted matrix
Use cases
- Prove that programmatic JSON construction survives quotes and backslashes
- Local reference before choosing a payload-building technique
- Teaching the difference between serialization and string concatenation
- Checking suspicious strings before handing them to an external system
Requirements
- n8n 2.47.7 or compatible node versions
- No credentials and no network access
- Edit the cases array in the Code node to test real values
Setup and testing in n8n
- Import the workflow JSON into n8n
- Click Execute Workflow on the Manual Trigger
- Inspect Summarize Escape Matrix output: totalCases=7, matchedCount=6
- Confirm the non-string case c7 is reported as distorted
- Add a new string case and verify the row count grows by one
- Empty the cases array to verify the aggregation warning path
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 (9)
Manual Trigger
Manual Trigger
Build Cases And Roundtrip
Code
Did Value Survive?
If
Format Survived Row
Set
Format Distorted Row
Set
Clean Path Marker
No Op
Merge Matrix Rows
Merge
Summarize Escape Matrix
Code
Matrix Ready
No Op
Note Stages
Sticky Note
Note Expected Results
Sticky Note
Note Real Input
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