Skip to content
Architecture5 min read

By · Editorial policy

Temporal vs BullMQ for Jobs and Durable Workflows

Use BullMQ when independent jobs or explicit parent-child dependencies match your work. Use Temporal when a business process has lasting state, timers, and messages such as approval decisions. Compare them by what resumes after failure and which state your application still has to store.

What is the practical answer?

Choose BullMQ when your recovery unit is a job or a tree of dependent jobs. A failed or stalled job can run again, and a Flow can defer its parent until its children finish. Choose Temporal when one durable process needs to remember past decisions, wait for an approval or timer, and continue across worker failures. A Temporal worker reconstructs workflow state from recorded events, while Activities that did not report completion can still retry. Neither model can decide whether a remote payment succeeded after a lost response. Use a provider idempotency key and read back the receipt before allowing another charge. To evaluate both approaches, kill the worker after a test provider accepts the request, then submit a duplicate approval while the process waits. Compare which state each tool preserves, which repair code you must own, and whether an operator can prove the outcome.

Evidence: Temporal durable execution · Temporal Signals, Queries, and Updates · BullMQ stalled jobs · BullMQ parent-child Flows · BullMQ job IDs · BullMQ PostgreSQL backend

Workflow external effect states from prepared through confirmed or unknown
A lost response creates an unknown outcome. Reconcile it before another dispatch. Diagram by Orch8 Engineering.

Compare what resumes after a worker fails#

The useful comparison starts with a failure. A queue worker dies while making a thumbnail. Retrying the image job from its input is usually acceptable if it overwrites the same output. An order fulfillment worker dies after a payment authorization and before a supplier confirms stock. The order still needs a deadline, the payment receipt, and a record of which decision comes next.

QuestionBullMQTemporal
What does it recover?A failed or stalled job can run again under the configured policies.A worker reconstructs workflow state from Event History. An unfinished Activity can retry.
How do steps depend on each other?Flows let a parent wait for child jobs. Application code owns the rest of the process state.Workflow code models dependencies, durable timers, and coordination.
How does an approval arrive?Persist the decision in the application and enqueue work when it arrives.Send a Signal or Update to the running Workflow and react to it there.
What runs in production?Workers plus a queue backend. Redis is the default. BullMQ 6 also supports PostgreSQL.Workflow and Activity Workers plus Temporal Service or Temporal Cloud.

Choose BullMQ when jobs are the right recovery unit#

Thumbnails, exports, cache refreshes, and independent deliveries are good fits. Give each job a well-defined input, retry policy, and success condition. A Flow can model a collection of child jobs that must finish before one final aggregation job runs.

Look for the code around the queue. If every processor updates a shared state table, a separate timer expires decisions, and a reconciler repairs missing callbacks, draw those components as part of the design. Some applications already own them cleanly, so the queue can stay small. If the same coordination logic appears in several services, compare it with a workflow implementation.

Choose Temporal when the process has a durable identity#

A workflow can wait for an approval or a timer, retain the result of a completed Activity, and continue through a worker replacement. Model the business transitions in Workflow code and put provider calls in Activities. Temporal re-executes Workflow logic against recorded events to reconstruct state, so changes to that logic must remain compatible with relevant histories.

Evaluate this model for onboarding that waits on several systems, order fulfillment that needs compensation, or renewals that can wait days for a customer decision. The workflow has a state you need to inspect even between jobs.

Test the same lost payment response in each model#

Use a fake payment provider that stores requests under a stable intent ID. Return a timeout after saving a successful authorization. Stop the worker before it reports success. In the BullMQ version, let the job retry. In the Temporal version, let the Activity retry. Confirm both implementations recover the original authorization or stop with enough evidence to reconcile it.

Then add an approval that expires. Restart the workers while the run waits and submit the approval twice. Record where each implementation keeps the deadline, accepted decision, provider receipt, and audit record. An enqueue-time job ID controls queue insertion while its job record exists. It cannot replace the payment provider's idempotency key.

  • Use the same provider fixture, timeout, and retry budget for both runs.
  • Confirm the provider saw one business intent and the application observed one accepted decision.
  • Check what an operator can inspect before manually retrying.

Keep the jobs that already recover cleanly#

Migrate one process whose state is expensive to reconstruct. Preserve existing business identifiers and place the cutover at a boundary where new work has one owner. Let existing runs finish on the original path unless you have verified a procedure for moving their state. Measure implementation effort and incident recovery on the same example before making a wider change.

Orch8 publishes this comparison. Its engine uses JSON workflow definitions and saved state snapshots, so it gives teams another execution model to evaluate if they need a workflow engine.

Sources and further reading

Official references support technical claims; community discussions are used only as problem signals.