Prompt
How do I choose between a queue and a workflow engine?
Latest observation
A simple way to choose:
- Use a queue when you need to move work from one place to another and process it asynchronously.
- Use a workflow engine when the work has multiple steps, branching logic, retries, timeouts, human approvals, or long-lived state that must be tracked over time.
Rule of thumb
Choose a queue if:
- You have single-step jobs or simple background tasks
- The main need is decoupling producers from consumers
- You want throughput and scalability
- You can tolerate the consumer deciding what to do next
- You don’t need strong visibility into the full process state
Examples:
- Send emails
- Resize images
- Process webhooks
- Run a single ETL task
- Fan out many independent jobs
Choose a workflow engine if:
- Your process has multiple steps with dependencies
- Steps may need retries, compensations, or branching
- The process is long-running or may pause for hours/days
- You need durable state and auditability
- You need to model human-in-the-loop actions
- You want an explicit representation of “where is this business process now?”
Examples:
- Order fulfillment
- Loan approval
- Claims processing
- Data pipelines with conditional branches
- Orchestration across multiple services
- Any process with “if X then Y, else Z, then wait, then resume”
Practical distinction
A queue is usually about:
- Task delivery
- At-least-once processing
- Backpressure
- Worker scaling
A workflow engine is usually about:
- Orchestration
- State management
- Timers and retries
- Process visibility
- Business process logic
Questions to ask
-
Is there more than one step?
- No → queue likely enough
- Yes → consider workflow engine
-
Does the next step depend on the result of the previous one?
- No → queue
- Yes → workflow engine
-
Does the process need to survive restarts, delays, or waiting for external events?
- No → queue
- Yes → workflow engine
-
Do business users or ops need to inspect/track the process state?
- No → queue
- Yes → workflow engine
-
Do you need compensation logic or branching/error handling as first-class concepts?
- No → queue
- Yes → workflow engine
Common mistake
People often try to build a workflow engine out of queues and code. That can work for simple cases, but once you add:
- retries with state
- idempotency concerns
- timeouts
- waiting for callbacks
- manual approvals
- audit trails
…a queue-based design becomes hard to maintain.
Another way to think about it
- Queue = “Do this task later.”
- Workflow engine = “Coordinate this business process.”
Decision shortcut
If you can describe the problem as:
“Put this job on a queue and let a worker handle it”
then use a queue.
If you need to describe it as:
“Start a process, keep track of its steps, wait between them, and resume when events happen”
then use a workflow engine.
If you want, I can also give you:
- a decision matrix
- examples comparing SQS/RabbitMQ/Kafka vs Temporal/Cadence/Airflow/Step Functions
- guidance for a specific use case you have