Skip to content
Developer & DevOps

Execution Witness Ledger: Prove Which Nodes Run On An Idle IF Branch Before Merge

9 nodes 9 0 Manual trigger
Download

Loading workflow…

Workflow Description

A self-contained n8n template that proves which nodes actually execute when an IF node leaves one branch permanently empty. A Code node emits valid and malformed sample records, an IF node splits them, and each path contains a NoOp witness followed by a Code node that records its own execution event and the item count it saw. Merge in append mode collects only the reports that exist, finishing without waiting on the empty branch, and a final Code node emits one proof row per witness plus a summary. Sticky notes document every stage. No credentials, no external calls.

How it works

  1. 1.Manual Trigger fires the template with one empty item.
  2. 2.Generate Sample Records builds four demo JSON records (valid and invalid) and normalizes status with type checks.
  3. 3.Route Active Vs Idle (IF, strict) sends active records to output 0 and intentionally leaves output 1 empty.
  4. 4.A NoOp witness on each path represents an observable downstream node.
  5. 5.A Code witness on each path records {witness, branch, executed, itemCount, validRecords} and returns nothing when no items arrive.
  6. 6.Merge (append, 2 inputs) joins whichever witness reports exist, one branch per input index.
  7. 7.Build Witness Ledger compares the expected roster with the recorded reports and outputs one row per witness plus LEDGER_SUMMARY.

Use cases

  • Verify idle-branch behaviour on your current n8n version before shipping a multi-branch flow
  • Diagnose the No Merge Data Found error caused by an always-empty IF branch
  • Keep a per-run record of which nodes actually executed for engineering reviews
  • Teach Merge append input indexing safely

Requirements

  • n8n 2.47.3 with manualTrigger, Code, If, Merge, NoOp and StickyNote nodes
  • No credentials and no network access required
  • For real data: replace the records array or wire your source into the IF node using {id, customer, amount, status}

Setup and testing in n8n

  1. Import the JSON into n8n and click Execute Workflow.
  2. Confirm three output items: active witness executed=true with itemCount 4, idle witness executed=false with itemCount 0, and the summary.
  3. Edge case: change one record status to 'closed' and rerun; both witnesses become executed=true with split counts.
  4. Edge case: empty the records array; a single invalid placeholder item is produced and Merge still completes.

Service Value

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

Apps Used

Manual Trigger Code If No Op Merge

Details

Trigger Manual trigger
Nodes 9
Apps 5
Views 9
Downloads 0

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

Generate Sample Records

Code

#2

Route Active Vs Idle

If

#3

Witness Active Branch

No Op

#4

Witness Idle Branch

No Op

#5

Record Active Witness

Code

#6

Record Idle Witness

Code

#7

Merge Witness Reports

Merge

#8

Build Witness Ledger

Code

#9

Note Input Stage

Sticky Note

#10

Note Branch Stage

Sticky Note

#11

Note Merge And Ledger

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