Execution Witness Ledger: Prove Which Nodes Run On An Idle IF Branch Before Merge
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.Manual Trigger fires the template with one empty item.
- 2.Generate Sample Records builds four demo JSON records (valid and invalid) and normalizes status with type checks.
- 3.Route Active Vs Idle (IF, strict) sends active records to output 0 and intentionally leaves output 1 empty.
- 4.A NoOp witness on each path represents an observable downstream node.
- 5.A Code witness on each path records {witness, branch, executed, itemCount, validRecords} and returns nothing when no items arrive.
- 6.Merge (append, 2 inputs) joins whichever witness reports exist, one branch per input index.
- 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
- Import the JSON into n8n and click Execute Workflow.
- Confirm three output items: active witness executed=true with itemCount 4, idle witness executed=false with itemCount 0, and the summary.
- Edge case: change one record status to 'closed' and rerun; both witnesses become executed=true with split counts.
- 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
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
Generate Sample Records
Code
Route Active Vs Idle
If
Witness Active Branch
No Op
Witness Idle Branch
No Op
Record Active Witness
Code
Record Idle Witness
Code
Merge Witness Reports
Merge
Build Witness Ledger
Code
Note Input Stage
Sticky Note
Note Branch Stage
Sticky Note
Note Merge And Ledger
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