Skip to content
Developer & DevOps

Special Character JSON Escape Behavior Reference Matrix

9 nodes 58 2 Manual trigger
Download

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. 1.Manual Trigger emits one empty item
  2. 2.Code node builds special-character cases and runs stringify/parse roundtrip in try/catch with literal comparison
  3. 3.IF node routes matched=true to the clean path and matched=false to the distortion path
  4. 4.First Set node adds verdict=survived with includeOtherFields
  5. 5.Second Set node adds verdict=distorted with includeOtherFields
  6. 6.NoOp node documents the clean path
  7. 7.Merge (append, 2 inputs) collects all rows
  8. 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

  1. Import the workflow JSON into n8n
  2. Click Execute Workflow on the Manual Trigger
  3. Inspect Summarize Escape Matrix output: totalCases=7, matchedCount=6
  4. Confirm the non-string case c7 is reported as distorted
  5. Add a new string case and verify the row count grows by one
  6. Empty the cases array to verify the aggregation warning path

Service Value

Ready-made workflow template for automation delivery and service execution.

Apps Used

Manual Trigger Code If Set No Op Merge

Details

Trigger Manual trigger
Nodes 9
Apps 6
Views 58
Downloads 2

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 (9)

/

Manual Trigger

Manual Trigger

#1

Build Cases And Roundtrip

Code

#2

Did Value Survive?

If

#3

Format Survived Row

Set

#4

Format Distorted Row

Set

#5

Clean Path Marker

No Op

#6

Merge Matrix Rows

Merge

#7

Summarize Escape Matrix

Code

#8

Matrix Ready

No Op

#9

Note Stages

Sticky Note

#10

Note Expected Results

Sticky Note

#11

Note Real Input

Sticky Note

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