Skip to content
Data & Databases

Set Expression Generator from Nested JSON String with Verification

9 nodes 45 4 Manual trigger
Download

Loading workflow…

Workflow Description

Self-contained manual workflow emits two fictional items: a valid nested JSON string and a broken one. A Code node parses each inside try/catch, recursively traverses with no depth limit, and emits rows (path, value, type, ready n8n expression) with internal verification that each path resolves to its listed value. Broken text yields one diagnostic row with a deterministic reason; an IF node separates valid rows from failure rows, a Merge appends them, and a final Code node builds one summary report with counters and a paste-ready expression list. The forum Object.entries pattern is documented on a sticky note.

How it works

  1. 1.Run manually; sample node emits a valid and a broken JSON text item
  2. 2.Code node safely parses and recursively generates rows with internal path verification
  3. 3.Set node standardizes fields and retains identifiers via includeOtherFields
  4. 4.IF node splits valid path rows from the diagnostic failure row
  5. 5.NoOp branches feed a two-input append Merge
  6. 6.Final Code node returns one summary report with counters, failure reasons and expressions

Use cases

  • Turn nested JSON-in-JSON text into ready n8n expressions
  • Generate verified path lists for Set or IF nodes
  • Diagnose JSON parse errors (single quotes, trailing comma) without stopping execution
  • Document unknown payload structure before building the final workflow

Requirements

  • No credentials; no external calls or AI
  • For real use: feed any item with a string `payload` field instead of the sample node

Setup and testing in n8n

  1. Import the JSON into n8n, open Manual Trigger, click Execute
  2. Check Build Summary Report: 13 verified valid rows and 1 failure row (single quotes reason)
  3. Edge cases: empty payload, empty array, key with spaces, deeply nested JSON
  4. Copy ready_expression values into a Set node and confirm evaluation

Service Value

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

Apps Used

Manual Trigger Code Set If No Op Merge

Details

Trigger Manual trigger
Nodes 9
Apps 6
Views 45
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

Build Sample Payloads

Code

#2

Parse JSON & Generate Verified Paths

Code

#3

Format Expression Rows

Set

#4

Is Parse OK

If

#5

Valid Paths Branch

No Op

#6

Failure Diagnostics Branch

No Op

#7

Combine All Rows

Merge

#8

Build Summary Report

Code

#9

Sticky: Stages & Object.entries Pattern

Sticky Note

#10

Sticky: Setup & Usage

Sticky Note

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