Skip to content
AI Agents

JSON Text Health Diagnoser with Parse-Error Quarantine

8 nodes 104 7 Manual trigger
Download

Loading workflow…

Workflow Description

The workflow parses each JSON text independently inside try/catch, so one broken record never stops the rest. Valid records keep the parsed value and root type; failures are quarantined with ID, index, error category, a sanitized message and a bounded preview. Non-string input is rejected without coercion. An IF splits branches, Set nodes add status, Merge appends them, and a final Code node builds one report with counts. It does not repair content or validate schemas.

How it works

  1. 1.A Code node emits seven fictional {id, raw} records.
  2. 2.The parse node checks raw type, then runs JSON.parse in try/catch per record.
  3. 3.IF routes on parse_ok.
  4. 4.Two Set nodes add status valid or quarantined, keeping other fields.
  5. 5.Merge appends both branches; a final Code node builds one report sorted by index.

Use cases

  • Checking LLM-generated JSON before downstream use.
  • Quarantining hand-copied payloads with unescaped quotes.

Requirements

  • No credentials needed.
  • Adjust RAW_FIELD, ID_FIELD, PREVIEW_MAX and ALLOWED_ROOT_TYPES in the parse node.

Setup and testing in n8n

  1. Import the JSON into n8n.
  2. Click Execute Workflow.
  3. Confirm 3 valid and 4 quarantined records in the report.
  4. Add a record without id or raw and confirm missing-id or non_string_input classification.
  5. Set ALLOWED_ROOT_TYPES to ['object'] and confirm the array and number get quarantined.

Service Value

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

Apps Used

Manual Trigger Code If Set Merge

Details

Trigger Manual trigger
Nodes 8
Apps 5
Views 104
Downloads 7

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

Run Demo Manually

Manual Trigger

#1

Emit Sample JSON Texts

Code

#2

Parse Each Text Safely

Code

#3

Parsed Successfully?

If

#4

Mark Valid Record

Set

#5

Mark Quarantined Record

Set

#6

Combine Both Branches

Merge

#7

Build Diagnostic Report

Code

#8

Note Overview

Sticky Note

#9

Note Setup

Sticky Note

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