Step Functions or a job queue?
Choose orchestration based on who should own long-lived workflow state and recovery. Step Functions can make AWS-integrated state transitions and waits explicit; BullMQ can fit application-owned job processing with workflow state in your database. Neither removes the need for safe external effects, clear cancellation, and an operator recovery path.
Inside this article 6 sections +
The choice between Step Functions and a job queue becomes clearer when the workflow contains more than immediate work. A process that waits for approval, calls a provider, receives a callback, and compensates after failure needs durable state between those steps. Someone must own that state even while no worker is running.
Consider onboarding a customer workspace. The application validates the request, waits for an administrator's approval, provisions an external account, configures access, and records completion. A failure after provisioning may require reconciliation or cleanup. Compare how each design represents those states before comparing its first successful execution.
Choose the authority for workflow progress
With Step Functions, a state machine can own the orchestration path, waits, retries, and execution history while tasks perform bounded operations. The application still needs business records and a relationship between its operation identity and the workflow execution. A state-machine execution is not automatically the canonical customer account.
With BullMQ, workers can execute steps and flows can express job dependencies, while an application database often owns approval, current state, and recovery decisions. This can fit a product that already has a strong operation model, but the team must implement and operate the orchestration behavior that is not provided by the queue alone.
| Concern | Step Functions design | BullMQ-centered design |
|---|---|---|
| Long wait | Explicit state-machine wait or supported callback task | Durable application state plus later job admission |
| Step retries | Declared task retry policy | Job retry policy and application deadline |
| Business identity | Application operation linked to execution | Application operation linked to jobs |
| Operator recovery | Execution evidence plus business reconciliation tools | Job evidence plus application recovery tools |
| External side effect | Provider identity and reconciliation contract | Provider identity and reconciliation contract |
Choose the Step Functions type deliberately
Standard workflows support long-running executions, up to one year under the documented limit, and are a natural candidate for workflows with extended waits and audit needs. Express workflows have a five-minute duration limit and different execution and observability characteristics. Do not describe Step Functions as one uniform execution model.
Integration patterns also differ. Standard supports selected run-a-job and callback patterns, while Express supports request-response integrations. A human approval that may arrive tomorrow therefore needs a different design from a short event transformation. Verify the exact integration and workflow type rather than assuming every task supports every waiting pattern.
Execution guarantees are scoped to the service model. Explicit retries, redrives, and external calls still require careful effect handling. A provider can accept a provisioning request before its response is lost. Keep the provider operation identity and a reconciliation path regardless of how the orchestrator labels the task outcome.
Treat approval and callbacks as authorized transitions
An approval callback should identify the business operation, expected state, and approval authority. Verify the current actor's permissions and whether the approval is still valid before advancing. A late approval for an expired or canceled request should not restart provisioning automatically.
Where a task-token callback pattern is used, protect the token as a capability and avoid exposing it in logs or an unrestricted client payload. The application's approval endpoint can validate the business decision and then complete the relevant task through a trusted boundary. Token possession alone should not replace the product's authorization policy.
In a queue-centered design, the same logic belongs in a guarded database transition that creates the next durable job intent. Commit approval and dispatch intent together where possible. Otherwise, a crash after recording approval but before enqueue can leave a workflow permanently waiting despite a successful user response.
Give retries one understandable budget
Inventory retries in the orchestrator, worker, SDK, and provider client. A task retry that wraps a client with its own retry policy can multiply attempts. Define which layer owns the overall deadline and count all physical attempts against the downstream capacity budget.
Illustrative provisioning step contract:
input: stable onboarding operation and requested account revision
before effect: confirm workflow remains eligible
provider call: reuse the operation's provider identity
uncertain response: reconcile before creating another effect
output: provider reference plus durable business outcome
retry: same intent, bounded attempts, remaining deadline
Compensation is a business operation, not a rewind button. Deleting a provisioned account may be inappropriate after a user has started using it. Define which completed steps are reversible, who may authorize compensation, and how failed compensation is tracked. Keep those decisions visible in either platform.
Compare operating work as well as platform charges
For Step Functions, model the selected workflow type's billing dimensions, state transitions or execution duration, and the costs of invoked services. For BullMQ, include Redis capacity, workers, persistence, monitoring, upgrades, and the engineering effort of maintaining workflow recovery. Use current pricing for a real estimate rather than treating either option as inherently cheaper.
Count human recovery effort and observability gaps. A graphical execution history can help, but operators still need business context and safe actions. An application-owned workflow table can be clear, but only if transitions, ownership, and unresolved states are exposed deliberately.
Prototype the failure path before selecting
Implement the same bounded onboarding scenario in the strongest plausible design. Test approval after expiry, duplicate callback, provider acceptance followed by lost response, worker termination, cancellation during execution, and recovery after a long wait. Compare the amount of custom state machinery and the clarity of the final business outcome.
The reliable job guide develops durable intent, and reconciliation explains uncertain effects. Workflow architecture should select the platform that makes the complete lifecycle easiest to operate correctly.