Orchestration with BullMQ
Source-backed example app: examples/orchestration-bullmq/
Use this example when in-memory orchestration is no longer enough and workflow runs need to survive process restarts. It wires the BullMQ adapter into the orchestration plugin, protects the management routes, and shows how route middleware and request-context resolution attach to the orchestration surface.
What this demonstrates
Section titled “What this demonstrates”createBullMQOrchestrationAdapter()with Redis connection settings- protected orchestration routes with
routeMiddleware - request context resolution from headers
- bounded job retention for completed and failed workflow jobs
Source Files
Section titled “Source Files”examples/orchestration-bullmq/src/index.tsexamples/orchestration-bullmq/app.config.ts
Production Notes
Section titled “Production Notes”Set requireTls: true in production and pass a real Redis TLS block. The
example defaults to local Redis for development but the app.config.ts keeps
TLS enabled so production config fails closed.
The example also sets shutdownDrainTimeoutMs and BullMQ retention limits.
Those are operational controls, not cosmetic settings: they keep deploys from
dangling workers and keep Redis from growing without bounds.