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

  1. Instantiate a FlowProducer connected to the same Redis instance as your queues
  2. 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
  3. 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
  4. 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
  5. 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
  6. Nest flows arbitrarily deep by giving a child job its own 'children' array to build multi-level job hierarchies

Known gotchas

Related routes

Configure BullMQ repeatable jobs and worker concurrency
docs.bullmq.io · 5 steps · unrated
Run reliable background jobs with BullMQ
bullmq · 4 steps · unrated

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?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans