Temporal
1.xSummary
Durable workflow execution platform that persists workflow state and activity history, enabling long-running stateful processes (minutes to years) that survive failures, retries, and restarts without application-level checkpointing: workflows are expressed as ordinary code.
Primary Use Case
Orchestrating multi-step business processes that span services, tolerate partial failures, and require exactly-once execution semantics: payment flows, order fulfillment, data pipelines, infrastructure provisioning, and saga compensation workflows.
Consistency & Transactions
Scaling
Read scalability
Temporal's frontend, history, and matching services scale horizontally. Task queues distribute work across worker instances. Adding workers increases activity execution throughput without coordination.
Write scalability
Workflow history is stored in PostgreSQL or Cassandra (configurable). Write throughput scales with the storage backend choice. Cassandra backend handles higher throughput at larger workflow counts.
Failure Behavior
Known failure modes
- ·Worker process crash: in-flight activities are automatically retried when a new worker reconnects
- ·History size limit: workflows exceeding 51,200 events or 50 MB of history hit Temporal's hard limit (warns at 10,240 events / 10 MB): use ContinueAsNew
- ·Clock skew in timers: Temporal timers are durable and wall-clock accurate regardless of worker availability
- ·Determinism violation: workflow code must be deterministic across replays: non-deterministic code causes panic
Degradation patterns
- ·High workflow count with large histories degrades Temporal server performance: archive completed workflows
- ·Overloaded task queues cause activity start latency increase: add workers to the relevant queue
- ·Complex workflow logic with tight loops can stress the history service: use batching and Sleep
Recovery considerations
- ·Worker crashes are transparent: workflows replay to the last durable activity result
- ·Server failure: Temporal's high-availability configuration with multiple frontend/history replicas survives single-node failure
- ·Storage backend failure: if PostgreSQL or Cassandra backing Temporal fails, in-flight workflow tasks are suspended until storage recovers
Architecture Guidance
Common topology roles
Migration notes
- ·Migrating from cron jobs: map each multi-step process to a workflow function, each step to an activity, and each compensation operation to a compensating activity
- ·Temporal replaces custom state machines stored in the application database: existing state machine rows can be migrated by seeding initial workflow state via Signal on startup
- ·Temporal Cloud (managed offering) reduces operational burden for teams without Kubernetes expertise; self-hosted requires PostgreSQL or Cassandra as backing store
Advisor Guidance
When: scenario has distributed saga requiring compensation workflows
Temporal's durable execution model eliminates custom saga state machine implementation; consider replacing application-level saga coordination with Temporal workflows
When: scenario has long-running async processes (payment processing, provisioning)
Temporal durably tracks workflow state across failures; avoids polling databases for job status
Comparison Factors
operational complexity
Medium: cluster deployment with separate services; managed Temporal Cloud available
latency
10–50ms per activity dispatch: appropriate for async workflows, not synchronous request paths
durability
High: workflow state is persisted durably; survives worker and server failures
cost
Open source self-hosted; Temporal Cloud is usage-based pricing
Basis
Temporal is a production-grade workflow engine developed by Uber engineers as a successor to Cadence; extensively documented with production case studies from Stripe, HashiCorp, Netflix, and others
Related Architecture Knowledge
Outbound: this entity affects
Temporal handles durable workflow orchestration and long-running state machines; Kafka handles high-throughput event streaming. They complement each other when workflows react to Kafka events or emit events on completion.
Full relationship →Temporal provides durable workflow execution with compensation support, implementing the saga pattern without custom state machine code in the application.
Full relationship →