Unicode & Emoji Escaper with Round-Trip Proof
Loading workflow…
Workflow Description
A fully local workflow that converts every character outside safe printable ASCII into a \uXXXX sequence and then proves that unescaping restores the original string byte-for-byte. The manual trigger loads five fictional texts (⛔ emoji, plain ASCII, a quoted string, a non-string value and the surrogate-pair 🙂). A Code node escapes each one, unescapes its own output and compares strictly. An IF node routes verified pairs to a Set node that tags them and stores the paste-ready value, failures to a NoOp with a reason, then both branches merge into a single aggregated report.
How it works
- 1.Manual Trigger starts the run and emits one empty item.
- 2.Load Sample Texts emits five fictional {id, text} items.
- 3.Escape & Verify Round Trip replaces each UTF-16 code unit outside 32-126 (excluding " and \) with uppercase \uXXXX and counts them.
- 4.The same node unescapes its output and compares it strictly with the original, setting roundTripVerified and failureReason.
- 5.The IF node checks roundTripVerified = true and splits the two paths.
- 6.Set tags verificationStatus=verified plus safeForExpression while keeping all other fields.
- 7.NoOp quarantines failed texts along with their failure reason.
- 8.Merge (append, 2 inputs) joins both branches.
- 9.Build Escape Report runs once for all items and returns exactly one item with counters and rows sorted by id.
Use cases
- Convert emoji-bearing user text into safe \uXXXX sequences before pasting into n8n expressions.
- Batch-check texts for escape round-trip safety before building JSON templates.
- Isolate non-string or corrupted fields in one list with an explicit reason.
- Produce a single report documenting the original/escaped pair for review.
Requirements
- n8n 2.47.7 or newer (node types used here).
- No credentials or API keys; the workflow is fully offline.
- For real data: replace Load Sample Texts with your own source using the same {id, text} schema.
Setup and testing in n8n
- Import the JSON into n8n and save it (workflow stays inactive).
- Click Execute Workflow and inspect Build Escape Report: one item with totalTexts=5, verifiedCount=4, failedCount=1.
- Confirm row t1 has escaped = "Stop \u26D4 now" and t5 contains the pair \uD83D\uDE42.
- Confirm t2 (pure ASCII) has escapedCharCount=0 and status verified with unchanged text.
- Edge case: t4 with null is routed to the NoOp branch with status failed and a reason naming type object.
- Add a new text in Load Sample Texts (e.g. a newline or tab) and re-run to see it escaped and documented.
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 (8)
Manual Trigger
Manual Trigger
Load Sample Texts
Code
Escape & Verify Round Trip
Code
Round Trip Verified?
If
Tag Verified Pair
Set
Quarantine Failed Text
No Op
Merge Branches
Merge
Build Escape Report
Code
Note Stages
Sticky Note
Note Algorithm
Sticky Note
Note Usage
Sticky Note
Note 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