Canonical Outgoing JSON Body Normalizer with Verification Fingerprint
Loading workflow…
Workflow Description
A fully local workflow that turns mixed-type body fields into one guaranteed root object. A Manual Trigger plus a Code node emit four fictional records: a serialized JSON string, a real object, an array root and a broken string. A normalizer Code node parses strings inside try/catch, wraps array roots under the declared key items and primitive roots under value, sorts keys recursively into canonicalBody, computes a deterministic fingerprint from length and character-code sum, and re-parses to prove a true root object. IF splits valid from rejected records, and Merge rejoins both branches through two separate inputs into a NoOp output.
How it works
- 1.Manual Trigger fires with one empty item
- 2.Code node emits four demo records with recordId and mixed-type body
- 3.Normalizer Code parses strings in try/catch, wraps arrays under items and primitives under value
- 4.Code sorts keys recursively, builds canonicalBody, computes fingerprint and re-parses for root validation
- 5.Set adds normalizerVersion while keeping all other fields
- 6.IF checks isValidRoot and separates valid from rejected
- 7.Set stamps routeLabel valid or quarantined per branch
- 8.Merge (append, two inputs) rejoins branches and NoOp exposes the final output
Use cases
- Normalizing request bodies from mixed-type upstream sources
- Detecting later payload drift by comparing the stable fingerprint
- Quarantining malformed JSON without stopping the run
- Auditing which records arrived as string, array or object
Requirements
- n8n with Code, Set, IF, Merge, NoOp and Sticky Note nodes
- No credentials and no external calls
- Input records following the schema recordId + body
Setup and testing in n8n
- Import the workflow JSON
- Click Execute Workflow and inspect the NoOp node: 4 items
- Confirm REQ-001 is a key-sorted object and REQ-003 is wrapped under items
- Confirm REQ-004 is quarantined with reason invalid_json_string
- Re-run and verify fingerprints are identical
- Edge case: remove the body field from a record and expect reason missing_body_field
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
Load Mixed Sample Bodies
Code
Normalize Root And Fingerprint
Code
Stamp Normalizer Version
Set
Is Valid Root Object?
If
Tag Valid Body
Set
Tag Quarantined Body
Set
Merge Valid And Quarantined
Merge
Normalized Bodies Output
No Op
Note Input Stage
Sticky Note
Note Normalizer
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