Temporal’s Tom Wheeler has published a guide to what durable execution is. His definition is crash-proof execution: a program’s progress is recorded, so after a crash, a restart or an outage it carries on from the step it reached instead of starting again. I built the guide’s example, killed the processes underneath it, and recorded what came back.
Two kills recovered cleanly. A code change made while a workflow was running did not, and Temporal raised no error when it went wrong.
What the guide says
The guide boils the idea down to four traits. The code is crash-proof, so a failure part-way through doesn’t lose the work done so far. A workflow’s history of events is saved and replayed to rebuild its state. Timers and sleeps are durable, so a workflow can wait days without holding a process open. Local variables survive too, because replay rebuilds them.

How it works underneath
In Temporal, your code runs in workers that poll a task queue on the Temporal server. The workflow function decides what happens next, and each side effect, such as an API call, runs as an activity. The server writes every step to an event history. When a worker dies, a new one picks the workflow up and replays that history: steps that already finished return their recorded results instead of running again, and the step that was in flight runs again.
That replay is why workflow code has to be deterministic, and why an activity runs at least once rather than exactly once.

What I ran
Everything ran on one Linux machine with 4 vCPUs (Intel Xeon at 2.30 GHz), 15 GiB of RAM, a 252 GB disk and Ubuntu 24.04. The Temporal dev server, the workers and the client all shared it. I used Temporal CLI 1.10.1 (server 1.32.2), the Python SDK temporalio 1.37.0 and Python 3.13, with the server’s SQLite file as its store.
The app has two workflows. FiveSteps runs five six-second activities, A to E, with a 30-second timeout each, and returns the name of the process that finished each one. Notifier sleeps for 5, 10 and 15 seconds in turn, standing in for days, and records a notice after each.
import asyncio, os, sys, time, datetime
from datetime import timedelta
from temporalio import activity, workflow
from temporalio.client import Client
from temporalio.worker import Worker
LOG = os.environ.get("RUNLOG", "run.log")
def log(msg):
with open(LOG, "a") as f:
f.write(f"{time.strftime('%H:%M:%S')} pid={os.getpid()} {msg}\n")
@activity.defn
async def step(name: str) -> str:
log(f"activity {name} started")
await asyncio.sleep(6)
log(f"activity {name} finished")
return f"{name}-done-by-{os.getpid()}"
@workflow.defn
class FiveSteps:
@workflow.run
async def run(self) -> list[str]:
results = [] # a plain local variable
for n in ["A", "B", "C", "D", "E"]:
results.append(await workflow.execute_activity(
step, n, start_to_close_timeout=timedelta(seconds=30)))
return results
@workflow.defn
class Notifier:
@workflow.run
async def run(self, user: str) -> list[str]:
sent = [] # survives the crash too
for i in [5, 10, 15]: # seconds standing in for days
await asyncio.sleep(i) # durable timer inside a workflow
sent.append(f"notice after {i}s to {user}")
return sent
async def main():
mode = sys.argv[1]
c = await Client.connect("localhost:7233")
if mode == "worker":
log("worker up")
async with Worker(c, task_queue="q", workflows=[FiveSteps, Notifier], activities=[step]):
await asyncio.Event().wait()
elif mode == "start":
wf = {"five": FiveSteps.run, "notify": Notifier.run}[sys.argv[2]]
args = ["sam"] if sys.argv[2] == "notify" else []
h = await c.start_workflow(wf, *args, id=sys.argv[3], task_queue="q")
print("started", h.id)
elif mode == "result":
h = c.get_workflow_handle(sys.argv[2])
print("RESULT", await h.result())
if __name__ == "__main__":
asyncio.run(main())
The server, a worker and a run are started like this:
temporal server start-dev --db-filename dev.db
python app.py worker
python app.py start five five-2
python app.py result five-2
Test 1: kill the worker during step C
I started FiveSteps, waited for step C to begin, then ran kill -9 on the worker. With no worker, the workflow sat at 17 history events. I started a new worker eight seconds later.
Step C didn’t restart straight away. The server held it until the 30-second activity timeout had run out, then gave it to the new worker, which ran C again and carried on to E. The result shows the hand-over: A and B were finished by the first process, and C, D and E by the second.


The log also shows step C starting twice, once on each process, and only the second run finishing. That’s the at-least-once rule in practice: an activity that charges a card or sends an email has to cope with running again.
Test 2: kill the server and the worker during a timer
The harder case takes out the thing that holds the history. I started Notifier, let its first timer fire, and killed the server and the worker together while the second timer was running. I left them down for twelve seconds, longer than the timer had left, then restarted the server on the same database file and started a new worker.
The workflow was still there, and all three notices were sent. The second timer was due about six seconds before the server came back, and it fired at the moment the server restarted, so it was six seconds late. The third timer then ran its full fifteen seconds.

Test 3: change the code while a workflow is running
This one isn’t a crash. I started FiveSteps, let steps A and B finish, killed the worker, and started a new worker running a changed version of the code with one extra step, Z, at the front of the list.
Temporal replayed the old history against the new code and matched recorded results to steps by activity type and position, not by the arguments they were called with. The workflow finished with no error and returned six results. Step Z got A’s result, A got B’s, and step C ran twice:
["A-done-by-1005","B-done-by-1005","C-done-by-1096","C-done-by-1096","D-done-by-1096","E-done-by-1096"]
Nothing in the output says the history and the code disagreed. Temporal’s documentation points to Worker Versioning and patching for changing code under running workflows, and this run shows why they exist.


The same kill on DBOS
DBOS takes a different route. It’s a library that runs inside your own process and keeps its record of completed steps in a database, so there’s no server to run. I wrote the same five steps with DBOS 3.7.0, using its SQLite option, which its own log says is for development and testing, and killed the process during step C.
import os, sys, time
from dbos import DBOS, DBOSConfig, SetWorkflowID
LOG = os.path.join(os.path.dirname(os.path.abspath(__file__)), "run.log")
def log(m):
with open(LOG, "a") as f: f.write(f"{time.strftime('%H:%M:%S')} pid={os.getpid()} {m}\n")
cfg: DBOSConfig = {"name": "five", "system_database_url": "sqlite:///dbos.sqlite"}
DBOS(config=cfg)
@DBOS.step()
def step(name: str) -> str:
log(f"step {name} started"); time.sleep(6); log(f"step {name} finished")
return f"{name}-done-by-{os.getpid()}"
@DBOS.workflow()
def five():
results = []
for n in "ABCDE":
results.append(step(n))
return results
if __name__ == "__main__":
DBOS.launch()
log("process up")
if sys.argv[1] == "start":
with SetWorkflowID("five-1"):
h = DBOS.start_workflow(five)
print("started", h.get_workflow_id())
print("RESULT", h.get_result())
else:
time.sleep(3)
print("RESULT", DBOS.retrieve_workflow("five-1").get_result())
Nothing restarts a killed process on its own, so I launched it again by hand. On launch DBOS logged that it was recovering one workflow, and step C started about a second later. The result was the same shape as Temporal’s: A and B from the first process, C, D and E from the second.

The difference is who does the waiting. Temporal’s server held step C until its timeout ran out and handed it to whichever worker was polling. DBOS had no server to hold anything, so recovery began as soon as a process came back.
The wider field
Every engine in this space keeps a journal of what has finished. They differ in where that journal lives and who runs it. Temporal and Restate run a server that your code talks to. Inngest runs a service that calls your functions. DBOS keeps the journal in your own Postgres. AWS Lambda, Cloudflare and Vercel now offer durable workflows as part of their platforms. Temporal Cloud is the hosted version of Temporal, and it bills per Action.

| Engine | Where your code runs | Where the journal lives | Licence or terms |
|---|---|---|---|
| Temporal | Your workers poll the Temporal service | Temporal server | MIT |
| Restate | The Restate server calls your handlers | Restate server | BUSL 1.1 |
| Inngest | Inngest calls your functions | Inngest service | SSPL with delayed Apache 2.0 |
| DBOS | Inside your own process, as a library | Your Postgres | MIT |
| AWS Lambda durable functions | On Lambda | AWS | Managed service |
| Cloudflare Workflows | On Workers | Cloudflare | Managed service |
| Vercel Workflows | On Vercel | Vercel | Managed service |
What the guide doesn’t cover
The guide explains the idea well, and my first two tests behaved the way it says. It doesn’t walk through versioning, and that’s where my third test went wrong without a sound. It also doesn’t dwell on the other cost of replay: because an activity runs at least once, every activity that touches the outside world needs to be safe to run twice.
So durable execution protects against a crashed process, a dead server and a long wait. It doesn’t protect against a deploy that changes the shape of a workflow that’s already running, or against an activity that can’t tolerate a second run. Those two stay with whoever writes the code.



