When to Reach for It: vs Step Functions, Airflow, and a Queue
| Temporal | AWS Step Functions | Airflow | Queue + retries | |
|---|---|---|---|---|
| You write | Ordinary code in your language | A state machine in JSON/ASL (or a CDK DSL) | A Python DAG | Handlers + your own state columns |
| Control flow | Native if, loops, try/catch, local variables | Declarative states, Choice, Map | Task dependencies; branching is awkward | Whatever you hand-build |
| Shape known before run? | No — fully dynamic | Mostly declared up front | Yes — it's a DAG | N/A |
| Long waits | Native; days to years, free while idle | Supported, up to a 1-year execution | Awkward — the scheduler owns the clock | You build a sweeper |
| Scheduled batch / backfill | Possible (Schedules), not its strength | Via EventBridge | Its whole reason for existing | Cron |
| Testing | Unit-test workflows in-process; replay real histories | Mostly integration testing | DAG tests, real runs | Normal, but the state machine is untested |
| Ops burden | High self-hosted (Cassandra + Elasticsearch); low on Cloud | None — fully managed | Medium — scheduler + workers + DB | Low |
| Lock-in | Open source, self-hostable | AWS | Open source | None |
| Cost shape | Per action / per workflow (Cloud) or your infra | Per state transition — chatty workflows get expensive | Your infra | Cheap |
Choose Temporal when…
The process is long-lived and stateful; branching depends on runtime data; steps are minutes to months; you want the logic in one testable function in your own language; and the alternative you're staring at is a status column plus three cron sweepers.
Choose something else when…
The work is a fixed nightly DAG over datasets (Airflow / Dagster); you're fully on AWS, the flow is a handful of Lambda steps, and running a cluster is unthinkable (Step Functions); or it's one idempotent job with no sequencing (a queue).
The Honest Costs
| Cost | What it actually feels like |
|---|---|
| Per-step overhead | Each activity is a few database writes and a couple of round trips. That is nothing next to a 200 ms API call and everything next to a 2 µs function. Temporal is an orchestration layer, not a compute layer — it is the wrong place for tight loops and per-event stream processing. At 100K events/sec you want Kafka and Flink, not 100K workflows/sec. |
| Operating the cluster | Self-hosting means running Cassandra (or MySQL/Postgres) plus Elasticsearch, sizing shards you can't change (see Inside the server), and understanding the queue processors. Many teams should start on Temporal Cloud and revisit later; the "we'll just run the docker-compose in prod" plan ends badly. |
| The determinism tax | Every engineer touching workflow code must internalize the Determinism part and Versioning. This is a real onboarding cost, and it is the thing teams underestimate — the failure mode is subtle, delayed, and surfaces as blocked workflows after a deploy, not as a failing test. |
| A new tier in the critical path | Your business processes now depend on a stateful cluster's availability. It degrades gracefully (workflows pause and resume rather than fail), but "paused" is still an outage to the customer waiting on their order. |
- Adopting it buys: Deletion of hand-rolled state machines, retry columns, and sweeper crons; complete auditability of every business process for free; and crash-tolerance as a property of the runtime rather than of your code.
- Adopting it does NOT buy: Distributed transactions, exactly-once side effects, a high-throughput event processor, or freedom from thinking about failure — it relocates that thinking to activity boundaries and idempotency keys.