Build a BullMQ job flow with parent-child dependencies using FlowProducer
domain: docs.bullmq.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Instantiate a FlowProducer connected to the same Redis instance as your queues
Call flowProducer.add() with a nested object describing the parent job and a 'children' array of child job definitions, each targeting its own queue name
BullMQ atomically creates the parent job plus all child jobs in one call; the parent enters the special 'waiting-children' state and will not move to 'waiting' (eligible for processing) until every child completes successfully
Run workers for each child queue as usual; once all children of a parent complete, the parent job automatically transitions to 'waiting' and is picked up by its own worker
In the parent job's processor, call job.getChildrenValues() to retrieve the return values of completed children keyed by job key, and aggregate/act on them
Nest flows arbitrarily deep by giving a child job its own 'children' array to build multi-level job hierarchies
Known gotchas
Removing a parent job removes all of its children; removing a child job removes only that child's link to the parent, and if it was the last unfinished child, the parent job is completed automatically
The parent queue does not have to be the same queue as its children — plan queue/worker topology deliberately since each queue has independent concurrency settings
A failed child does not automatically fail the parent by default — check current BullMQ docs for the exact failure-propagation and 'failParentOnFailure' options rather than assuming behavior
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?