
Temporal can carry unfinished work through server crashes, but it cannot by itself prevent an outside service from charging a customer twice. The workflow platform lets you arrange payment, stock and email steps in one function while keeping calls to outside services separate. Better Stack shows how replay uses recorded results to rebuild progress without rerunning completed calls. You can also pause work for 30 days without tying up extra worker resources. Find out how that recovery works and why retries still need protection against duplicate effects.
Temporal: Recover Workflows Through Replay
TL;DR Key Takeaways :
- Temporal reconstructs interrupted Workflow state by replaying recorded Event History on a replacement Worker.
- Activity retries start after one second and double up to 100 seconds by default, with no limit on attempts.
- Temporal recommends idempotent Activities because an external action can be repeated if a Worker crashes before reporting its completion.
- A DOOM project uses replay to restore game state, recording 8 bytes per player per game tick.
- At Netflix, the share of deployments failing from temporary glitches fell from 4% to 0.0001% with Temporal.
A server crash can interrupt an order after a customer has been charged but before stock is reserved or a confirmation is sent. Applications can use database statuses and scheduled jobs to recover the work, but developers must write and maintain that recovery logic, a repetitive and time-consuming task across systems.
Temporal is an open source durable execution platform from Temporal Technologies that records a workflow’s progress outside the application process. A replacement worker can use that record to reconstruct the workflow’s state and continue the work.
Workflows Separate Decisions From Outside Calls
A Temporal Workflow puts the sequence of a multi-step operation in one function. For a payment, that function can arrange the card charge, stock reservation and confirmation email from top to bottom.
Calls to outside services go into separate functions called Activities, each making one outside call. The Workflow decides when to run them, while an Activity carries out work such as contacting a card API or email service.
To run the code, you start a Worker on your own infrastructure. The Worker asks Temporal Server for tasks, executes the Workflow and Activity code, then reports the results. Temporal Server, which is written in Go and licensed under MIT, distributes tasks and keeps their records; it does not run the application’s code itself.
You can use a self-hosted Temporal Service or the managed Temporal Cloud service. Temporal provides SDKs for .NET, Go, Java, PHP, Python, Ruby, Rust and TypeScript.
Event History Lets a New Worker Replay Progress
Temporal records scheduled Activities and their results, along with timers and received messages, in an Event History. If a Worker stops, another Worker can use that history to reconstruct the Workflow’s state, including its local variables.
The process is called replay. Temporal normally runs the Workflow code again from its first line against the recorded history rather than restoring a snapshot of the program’s memory, although cached state can avoid a full replay.
Temporal co-founder Maxim Fateev first tried saving program memory in an Amazon prototype, but he said taking snapshots after every step produced abysmal performance. His team switched to replay, which needs only a small application library and could be built for any language.
For a payment Workflow, if the history already contains the result of the card charge, replay returns that saved result instead of executing the completed Activity again. Temporal repeats the process for recorded steps until the Workflow reaches work without a saved result.
Replay depends on the Workflow making the same decisions when given the same history. That requirement lets Temporal match the code’s decisions with the events it has already recorded.
Retries Need Protection Against Duplicate Effects
Temporal has built-in Activity retries, so a temporary failure does not require a separate scheduled job to pick up the work. If an email service is down, the default retry starts after one second, then doubles the delay up to 100 seconds. The default policy has no limit on attempts, and retry policies are configurable.
At Netflix, the share of deployments failing from temporary glitches fell from 4% to 0.0001% with Temporal.
A crashed Worker’s running Activity can time out and be retried on another Worker. The retry starts from the Activity’s initial state unless its code uses heartbeat details for checkpointing.
An outside action can finish before Temporal records its completion. If a Worker crashes after an external effect but before reporting it, the Activity may run again. Temporal therefore recommends idempotent Activities: repeating an Activity should not produce an unwanted duplicate effect, such as a second charge.
Retries alone cannot clear a permanent failure; its cause needs intervention. A closed Workflow Execution also cannot continue in the same run, so recovery after closure requires a reset or a new execution.
Timers and New Executions Manage Long Workflows
A Workflow can sleep for 30 days without Workers consuming extra resources while it waits, and Temporal’s documentation says a sleep can last several years. The timer is part of the Event History that Temporal uses to reconstruct the Workflow.
A single Workflow Execution has an Event History limit of 51,200 events or 50 MB, with warnings at 10,240 events or 10 MB. To manage a growing history, Continue-As-New starts a new Workflow Execution with a fresh Event History.
DOOM Shows Replay at Work
A project published on Temporal’s blog in November 2026 uses replay to restore DOOM to the frame where it stopped, including in multiplayer. When a Worker dies, a replacement replays the players’ recorded inputs so the game engine rebuilds the same state.
That approach relies on the engine’s predictable behavior: its random numbers come from a fixed table of 256 values, so the same button presses produce the same game. The history stores 8 bytes per player per game tick; the project’s authors calculated that saving the game’s memory instead would take more than 8 GB per minute.
The project can save the game and hand it to a fresh Workflow as its history grows. Temporal’s blog says one Workflow run would not hold a weekend-long death match.
Cloud Recovery Has Its Own Limits
Temporal reports that its Cloud service’s mean Namespace availability was above 99.9999% in each of the six months from May to October 2026, ranging from 99.99993% in May to 99.99998% in July and October. A Namespace is the unit covered by its availability reporting.
Across five tracked automatic-failover incidents in September and October, Temporal also reports that the worst Namespace recovery took 18 minutes, below its 20-minute objective. Temporal’s Cloud SLA covers specified Workflow start and signal requests rather than every API, and excludes certain causes of downtime.
For self-hosting, Temporal’s development server is one binary, while a production installation requires four services backed by a database such as Postgres, MySQL or Cassandra. The server runs independently of the application server. Workers still need to run the application’s code, and protecting external actions from duplicate effects remains part of the application’s design.
In our view, the real appeal is not the replay trick itself but that recovery stops being code every team rewrites. Keeping the steps in one readable function also makes the order of events easy to check. We would treat Netflix’s drop in failed deployments as one company’s result, not a promise. Before adopting it, count how often your own multi-step jobs fail, since the extra moving parts only pay off if that cost is real.
Better Stack recommends Temporal as an out-of-the-box answer for developers who repeatedly find themselves writing recovery code for multi-step operations. If you need applications to carry unfinished work through process crashes, Temporal is worth looking at in more detail.
Media Credit: Better Stack
Disclosure: Some of our articles include affiliate links. If you buy something through one of these links, Geeky Gadgets may earn an affiliate commission. Learn about our Disclosure Policy.