Skip to content
Data & Databases

Canonical Outgoing JSON Body Normalizer with Verification Fingerprint

9 nodes 86 4 Manual trigger
Download

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. 1.Manual Trigger fires with one empty item
  2. 2.Code node emits four demo records with recordId and mixed-type body
  3. 3.Normalizer Code parses strings in try/catch, wraps arrays under items and primitives under value
  4. 4.Code sorts keys recursively, builds canonicalBody, computes fingerprint and re-parses for root validation
  5. 5.Set adds normalizerVersion while keeping all other fields
  6. 6.IF checks isValidRoot and separates valid from rejected
  7. 7.Set stamps routeLabel valid or quarantined per branch
  8. 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

  1. Import the workflow JSON
  2. Click Execute Workflow and inspect the NoOp node: 4 items
  3. Confirm REQ-001 is a key-sorted object and REQ-003 is wrapped under items
  4. Confirm REQ-004 is quarantined with reason invalid_json_string
  5. Re-run and verify fingerprints are identical
  6. 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

Manual Trigger Code Set If Merge No Op

Details

Trigger Manual trigger
Nodes 9
Apps 6
Views 86
Downloads 4

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

Load Mixed Sample Bodies

Code

#2

Normalize Root And Fingerprint

Code

#3

Stamp Normalizer Version

Set

#4

Is Valid Root Object?

If

#5

Tag Valid Body

Set

#6

Tag Quarantined Body

Set

#7

Merge Valid And Quarantined

Merge

#8

Normalized Bodies Output

No Op

#9

Note Input Stage

Sticky Note

#10

Note Normalizer

Sticky Note

#11

Note Routing

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