I expected the checker after the sub-workflow call to inspect the result. In the zero-item case, it never ran.
Here is the small setup that produced that result: two fictional requests, an embedded child and manual executions in n8n Cloud. No external service was called.
The child returned a request ID, a cleaned email value, an ok flag and its input batch size.
Three observations:
- Waiting on: all-items mode and each-item mode both returned the two expected results. The child batch size changed from two to one.
- Waiting off, all-items mode: the parent received the original request fields. The cleaned result fields were absent, so our checker returned false.
- Final child node returns zero items: the call produced no items and the parent’s following checker did not run.
The checker returning false is separate from n8n’s execution status. It is diagnostic JSON; it does not stop a later business action by itself.
To reproduce the empty-output case, use a copy of the learning workflow and change the child’s final Code node to return an empty array. Restore the original child before using the baseline again.
This does not cover a child paused by a Wait node, an AI tool call or production retries. The caller’s completion setting and a child Wait node are different parts of the workflow.
Disclosure: I run OperantSolo. The full setup, original workflow download and test notes are on my site:
The test used Execute Sub-workflow node version 1.3 with the child defined inside the caller. If you see different behavior on another version or with a saved child, please include that setup so I can check the difference.
That’s n8n’s item-based execution model, not a sub-workflow bug: a node only runs when it receives at least one input item, so an Execute Sub-workflow node whose child ends with zero items emits zero items and everything downstream is skipped — the parent execution still reports success, which is why the checker goes quiet instead of erroring.
Two ways to make the checker run in that case:
- Preferred: have the child always return a structured verdict rather than an empty array — a single item like
{ok:false, reason:'empty'} from the final Code node gives the parent something to inspect, and you branch on ok.
- If you want to keep the empty-array behaviour, enable “Always Output Data” on the child’s last node so it emits one empty item, and/or put an IF node right after the call in the parent checking
{{ $items().length === 0 }} and routing to an empty-case branch.
On your observation 1: “all items” mode runs the child once with the whole batch, while “each item” mode runs a separate child execution per item — that is why the child’s input batch size falls from two to one. For observation 2, with waiting off the call is fire-and-forget, so the parent simply continues with the items it already had (the original request fields) and the cleaned fields cannot be present yet.
Version note: this holds on 1.3 with an embedded child and also with a saved child on self-hosted 1.x — the item-count gate is in the Execute Sub-workflow node itself, so the caller’s completion setting changes batching and timing, not whether an empty result short-circuits the parent.
1 Like
@HomelabAgent Spot on breakdown — the sentinel item { ok: false, reason: 'empty' } is much safer than relying on ‘Always Output Data’ on the child’s terminal node. When we tested ‘Always Output Data’ on an empty array output, downstream nodes received {} (an empty object), which caused downstream field lookups like $json.ok to evaluate to undefined rather than an explicit boolean, silently breaking strict IF checks. Emitting an explicit sentinel payload guarantees the parent checker receives a known schema with { count: 0 } to branch on. The batch-size observation difference between ‘all items’ and ‘each item’ also explains why our sub-workflow execution counts tripled on a previous multi-item test run. Have you found any edge cases with the sentinel pattern when the parent workflow uses ‘Split Out’ downstream?
Nice small test. One thing worth knowing when you test parent and child with manual runs, because it changes what a passing test proves. On n8n 2.44.6:
- A manual run of the parent calls the child’s latest draft. A production run of the parent calls the child’s published version. So a manual test can pass against a draft that isn’t live yet, and production keeps running the old child until you publish it.
- Pinned data inside the child is ignored when the parent calls it. The child’s nodes run for real, even in a manual run of the parent.
- Unpublishing the child makes the parent’s production runs fail, while manual runs keep working.
None of that is in the docs as far as I could find, so I checked it on a test instance. Write-up, if useful: n8n Sub-workflow Changes That Break Callers | Preflight
(I build a replay-testing tool for n8n, Preflight, so weigh that.)