When to Use
When a webhook returns{"message": "Error in workflow"} or {"code": 0, "message": "No item to return was found"} and you need to diagnose without opening the n8n UI. This method is faster and produces an auditable trace.
Prerequisites
Step 1: Get the Failed Execution
- Which nodes executed (and which didn’t — the gap reveals where it stopped)
- The error message and which node threw it
- Whether status is
error(crashed) orsuccess(completed but returned empty)
Step 2: Trace Data Flow Through Nodes
⚠️= node ran multiple times (duplication bug)- Items dropping to 0 between nodes (data lost)
- Wrong branch active (e.g., b[1] when b[0] expected)
- Node not in the list at all (never triggered)
Step 3: Inspect a Specific Node’s Output
Step 4: Check Workflow Connections
Step 5: Read a Node’s Code or Config
Common n8n Bug Patterns
| Symptom | Root Cause | Fix |
|---|---|---|
| Node runs 2-3x | Parallel fan-out into single node | Chain sequentially or add Merge node |
"Wrong type" on If node | typeValidation: "strict" + null/empty coercion | Change condition to number comparison (e.g., .length > 0) |
"No item to return" | Merge node with output: "empty" | Have downstream Code node use $('NodeName') references |
"Node X hasn't been executed" | $() reference to node that hasn’t finished yet | Chain nodes sequentially |
"Code doesn't return a single object" | Array return in runOnceForEachItem mode | Return {json: ...} not [{json: ...}] |
| SplitInBatches skips loop body | Batch size not explicitly set in v3 | Set Batch Size = 1 in Options |
| Context fields (repo, branch) empty | Upstream node output replaces config data | Use $('Config Node').first().json to reference config directly |
| HTTP 404 crashes pipeline | On Error: "Stop Workflow" on optional fetch | Set to "Continue (Using Regular Output)" |