Skip to content
Get started
Get started
Flow Failure Handling: When a Child Fails
guide · flow producer

One child dies. Now what?

The default is to keep waiting, which is rarely what you want. These four options let a failed child fail the parent, be ignored, cancel its siblings, or let the parent run on whatever succeeded.

By default a parent just keeps waiting for its remaining children. Four child options change what happens when a child fails terminally (no retries left):

OptionBehavior
failParentOnFailureParent immediately moves to failed, even if other children are still running
removeDependencyOnFailureThe failed child is silently dropped from the parent’s dependencies; the parent proceeds as if it never existed
ignoreDependencyOnFailureLike the above, but the failure is recorded; the parent can read it via job.getIgnoredChildrenFailures()
continueParentOnFailureParent is promoted to run immediately; it can inspect failures via job.getFailedChildrenValues() and cancel leftover children

Choose at most one policy per child. The selected policy and any unresolved failure record are durable: a broker restart cannot reset the child to default behavior or put an already-released parent back into waiting-children.

A worked example with continueParentOnFailure, useful when the parent should decide how to handle partial failure:

await flow.add({
name: 'pipeline',
queueName: 'main',
data: {},
children: [
{ name: 'step-a', queueName: 'workers', data: {}, opts: { continueParentOnFailure: true } },
{ name: 'step-b', queueName: 'workers', data: {}, opts: { continueParentOnFailure: true } },
{ name: 'step-c', queueName: 'workers', data: {} },
],
});
const worker = new Worker('main', async (job) => {
const failed = await job.getFailedChildrenValues();
// { 'workers:job-abc': 'Error: step-a failed', ... }
if (Object.keys(failed).length > 0) {
await job.removeUnprocessedChildren(); // cancel children still waiting
return { status: 'partial', failedSteps: failed };
}
return { status: 'complete' };
}, { embedded: true });

And with ignoreDependencyOnFailure, when the parent should continue with partial data:

const worker = new Worker('reports', async (job) => {
const ignored = await job.getIgnoredChildrenFailures();
// { 'workers:job-abc': 'Error: enrichment API timeout' }
return { partial: Object.keys(ignored).length > 0 };
}, { embedded: true });

All four failure-propagation options are ordinary job options and reach the wire in every SDK. The reading helpers (getFailedChildrenValues, getIgnoredChildrenFailures, removeUnprocessedChildren) are currently available in the Bun package, the TypeScript SDK and the Python SDK (on Queue, taking the job id).

Flow ProducerYour first parent/child graph, and what is guaranteed
Flow PatternsChains, fan-in, trees, reading child results, options
Flow Producer ReferenceEvery producer method, job helper and step field