Enterprise AI agents run for hours. They read tickets, ask models what to do, wait for approvals and then make changes to critical HR, IT, finance or identity systems. Most agents spend more time waiting on approvals than working. They need to keep their state for hours and survive server restarts, code deploys, and more.
The workflow engine underneath keeps the state. Its job is to pick up where it left off without crashing the agent or rerunning steps. We tested DBOS, Temporal, and Hatchet, the strongest open-source options, pushing them hard. We restarted engines mid-execution, shipped code during runs, and added timers to replicate approvals.
We decided to move forward with Temporal, and this blog explains why.
What does an enterprise agent need from its engine?
As established earlier, an enterprise agent run can take hours while it waits on approvals or is blocked by another agent (AI or human). To successfully accomplish its goal, an AI agent's workflow execution engine should:
Survive server restarts
Wait on approvals (hours or days)
Act only once. We cannot just re-run an agent with the ability to write to critical systems.
Handle code deploys without breaking agent runs that are in flight or waiting to be executed
Run inside your VPC
We pushed DBOS, Temporal, and Hatchet to their limits
We shortlisted DBOS, Temporal, and Hatchet from 20 workflow engines. Here are our selection criteria:
Solid Python SDK with community
Support durable execution
Self-hosting is a must
Independent of a cloud provider
DBOS, Temporal, and Hatchet support PostgreSQL and have MIT-licensed components. They take different approaches to solving the problem.
DBOS. DBOS runs as a library inside your application, storing state in PostgreSQL. There's no separate server to manage. Recovery and a centralized dashboard depend on Conductor, DBOS's proprietary offering.
Temporal. Temporal uses a central server to manage workflows, maintaining execution history, handling retries, and recovering workflows after failures. There's more infrastructure to run compared to DBOS, but everything needed is open source.
Hatchet. Hatchet runs as its own engine service on PostgreSQL, and workers pull tasks from it. It comes with centralized concurrency controls and a dashboard. It's MIT licensed, self-hostable, and relatively lightweight.
We wanted to test all three because they represent different ways of building a durable execution engine, and we wanted to find out whether those architectural differences mattered when things went wrong.
The rest didn't make the cut for different reasons. Restate, Golem, Inngest, Windmill, LittleHorse, and Obelisk had licensing terms that didn't fit our requirements. Trigger.dev and pgflow focused on TypeScript, while Cadence's Python client wasn't mature enough for us. Conductor OSS required a Java server and JSON-defined workflows. Prefect lacked the replay-based execution model we wanted, Absurd was missing global concurrency limits, and Dapr added more infrastructure than we needed. AWS Step Functions and Lambda durable functions were ruled out because we needed to support multiple clouds.
We tested them by writing one agent and storing it as data, so every engine ran the same steps through a generic runner. The agent follows a typical enterprise approval flow:
Read a ticket with a cheap model.
Look up the user in a directory.
Get a manager's approval.
Reason over three rounds on a stronger model, with a second approval in the middle.
Run a browser task.
Make three writes to an outside system.
Reply and close the ticket.
The outside systems were fakes, rejecting anything over a limit. Every call carried a key built from the run and the step, so they could count each repeated write and each overlap.
We applied pressure with a normal enterprise week's load and kept turning it up.
We restarted the engine while writes were in flight.
We shipped new code while runs were waiting on approvals.
We took away one replica for good.
We ran two workers through a burst to see whether limits held across both.
Then we scaled up: 60 runs, then 500, then 2,000 parked on approvals at once. A tenth of them sat on 45-minute timers, and we restarted the engine twice during the wait.
Here's how every scenario came out.
Temporal came through everything except one change we shipped without a guard, and even then it paused the runs safely. DBOS lost runs when a replica disappeared and when we deployed, both on default settings. Hatchet left runs stuck when we lost a replica, on some deploys, and heavily at scale.
The full soak was the biggest test. DBOS and Temporal finished all 2,000 runs with zero duplicates. We ran Hatchet at 500, since it had already stalled at that size, and it finished 356.
Two results were the same on every engine. All 450 timers in the full soak fired, the latest 9.3 seconds after its deadline. Every engine re-sent 1 to 3 writes after a restart, because none of them can tell whether a call finished before the process stopped. So give every write an idempotency key.
All three engines shared one Postgres. The first round ran on a laptop, and the follow-up on a small cloud machine (2 CPUs, 7 GB) with Hatchet's latest release. This is one agent, and our longest wait was 45 minutes, so read the numbers as a comparison, not a capacity plan.
Temporal carried every run.
It finished every run in every scenario but one, at every scale, and we didn't write any recovery code to get there. When one of two replicas went away, the other picked up all 20 waiting runs. When we shipped a new version with 5 runs waiting, all 5 finished. In the full soak, it finished 2,000 of 2,000.
The one time it didn't finish was our own doing. We changed the runner to add a step at the start of every run, then deployed it without a guard while 5 runs were waiting. Every engine failed this one. DBOS errored the runs for good and Hatchet failed them. Temporal paused them instead, and a paused run can be fixed. We rolled back and all 5 finished in 10.3 seconds. A patched version worked too, with all 5 done in 9.8 seconds. With the patch API in place from the start, it passed.
You can also see and steer every run. The server keeps the full history of each one, a step-by-step record of what the agent did and when. The UI, cancel, and reset are all open source.
There are two things you need to set yourself.
Limits are per worker. Temporal caps concurrent work on each worker process, so with two workers, our limit of 5 writes became 10, and 3 browser slots became 6. Outside systems pushed back with 6 write and 315 browser rejections, and retries absorbed all of them. DBOS and Hatchet enforce limits inside the engine and had none. The fix is to serve any queue with a global limit from one dedicated worker or use the server-side task-queue rate limit. Temporal has no per-user limit, so we wrote a 30-line workflow to keep one run at a time per user.
Recovery speed is a setting. Temporal only retries a call from a stopped worker after the call's timeout runs out. With a 60-second timeout, recovery took 67.6 seconds. With 10 seconds, it took 16.8 seconds. Heartbeats close the gap. On a 55-second job with the worker stopped 20 seconds in, a 10-second heartbeat started the retry 9.6 seconds later. Without one, it took 41 seconds on a 60-second timeout and 281 seconds on a 300-second timeout. When the job saved its progress in the heartbeat, the retry picked up at step 7 and redid nothing.
We also upgraded the Temporal server twice with 30 runs waiting, from 1.30.8 to 1.31.0 and then to 1.32.1. It was down for under 5 seconds each time. All 30 runs finished, nothing repeated, and timers fired within 0.3 seconds of their deadline.
DBOS is the lightest, but recovery is on you.
DBOS is the easiest to adopt. Our agent took about 230 lines in one file, against roughly 360 for Temporal and 345 for Hatchet. When a single process stopped and came back, every run was done 10.6 seconds later, the fastest of the three. It finished all 2,000 runs in the full soak with zero duplicates, and its limits held across replicas with no rejections.
DBOS struggled in two places, both on default settings.
The first is losing a replica. Without Conductor, a restarted process only recovers its own runs. When one of two replicas went away for good, half of the 20 waiting runs just sat there. DBOS documents this, and in practice it happens whenever an autoscaler removes a replica.
The second is deploys. By default DBOS sets the app version to a hash of your code, and recovery only resumes runs with a matching version. So any code change strands every run that's waiting on an approval. We saw 0 of 5 resume, both after a version bump and after a real code edit. The unguarded runner change from the Temporal section errored all 5 runs for good.
We fixed both. We wrote a watcher of about 40 lines: each process writes a heartbeat row every 2 seconds, and when a peer goes quiet for 10 seconds, a survivor resumes its runs. It found the dead replica in 11.1 seconds and rescued all 10 runs in 0.11 seconds. Pinning the app version fixed deploys, and the patch API handled runner changes.
The fixes work. But it's recovery code you own, and someone has to re-test it on every upgrade. Visibility is the other gap. The DBOS library is MIT, but the dashboard sits in Conductor with multi-replica recovery, and Conductor is proprietary.
Hatchet buckled at scale.
On paper, Hatchet was the best fit for us. It's MIT licensed, ships its own dashboard, needs only Postgres, and enforces limits inside the engine. Its limits held across replicas with no rejections, and small tests went fine.
The trouble came after approvals. A run would wait for approval, Hatchet would accept the approval, but the run would never move to its next step.
This was first observed on v0.107. Halfway through our follow-up tests, though, we found a bug in our own setup. The script playing the approver could crash on an unexpected error and go quiet, which from the outside looks exactly like an engine that lost a run. That bug was in our first round too, so some of the stuck Hatchet runs there may have been our fault.
We fixed the approver, had every run record its unanswered approvals, and re-ran Hatchet on v0.114. Restarts worked, with all 30 runs recovering. But runs still got stuck when a replica went down (86 of 100 finished across five tries) and on some deploys (18 of 25). Every stuck run had zero unanswered approvals.
Scale made things worse. In a 60-run test, Hatchet finished 55 and 56 across two tries. In the 500-run test, 205 runs (41%) never got past an accepted approval, while the machine sat idle. In the full soak, 181 of 500 runs got stuck, and every approval had been answered.
If you run Hatchet, add a sweeper to find runs waiting on answered approvals. Hatchet issue #4969 may be related, but we couldn't check its status. We'll test it again once this is fixed.
Well, what about cost?
Temporal held up best, but it's not the lightest.
DBOS adds no services at all. Temporal adds a server and a UI, and Hatchet adds an engine and a dashboard. DBOS peaked at 22 Postgres connections, against 60 for Temporal and 63 for Hatchet. Its database grew about 21 KB per run, against 84 KB and 284 KB. On speed, Temporal led our 300-run load test at 654 runs a minute. Hatchet did 490. DBOS did 159 on its defaults and 441 with a faster queue poll.
You can slim Temporal down. We built a single container with the server and its schema tool, leaving out the UI. It came to 224 MB on disk, about 105 MB of memory at idle, and 13 Postgres connections.
We decided to move forward with Temporal.
We picked self-hosted Temporal, with DBOS a close second.
Temporal won on the things that are expensive to get wrong in an enterprise. Losing a replica and shipping new code both just worked, with no recovery code of our own. It keeps the full history of every run. It was also the fastest in our load test.
It isn't free. We run two extra containers, and Temporal holds about 60 Postgres connections. We wrote our own per-user lane, and queues with a global limit get one dedicated worker. Payloads are capped at 2 MB, so model transcripts live in our own Postgres and we pass references around.
When is DBOS the better choice? When footprint decides it, say a small install on a single container. It runs on the Postgres you already have and enforces global and per-user limits for you. You'll own the replica watcher and version pinning, and our tests show both work.
And Hatchet? I believe it will be a strong option once runs stop getting stuck. Until then, we wouldn't put agents that wait on people on it.

