Durable execution for AI agents: the repo outlives the process
Why replaying a journaled process is the wrong guarantee for agent work, and how open-source Kortix makes the repository the durable unit.
Someone has told you that your agent needs durable execution. Now you are choosing between a queue, an engine and a workflow service to supply it. Ask which unit of state has to survive a crash: the process, or the work. Kortix is the open-source CompanyOS: your agents, their skills, your company memory, and every connector in one git repo you own, with the agents working on real cloud computers.
What an engine keeps, and what it asks of you
Every product in this category sells one guarantee. Temporal calls a Workflow Execution "a durable, reliable, and scalable function execution". It resumes by replay, "the method by which a Workflow Execution resumes making progress". Restate "tracks every step of your code execution in a journal". After a failure it "replays the journal, skipping completed steps and resuming from exactly where it left off". DBOS checkpoints each workflow and step to Postgres and "uses those checkpoints to recover each of your workflows from the last completed step". Inngest "resumes a run by replaying your handler and returning saved step results, so completed work does not run again". Microsoft's Durable Functions runtime manages state, checkpoints, retries, and recovery for the orchestrator functions you write. The pattern underneath is the same in each: run the code again, skip the steps the journal already recorded, continue from the first one it did not.
The guarantee holds. The price sits in the code that keeps it true. DBOS states the determinism requirement for the workflow function in full: "if executed multiple times, with the same arguments and step return values, the workflow should invoke the same steps with the same inputs in the same order." Everything the replay cannot reproduce moves into a step, and steps have to be safe to run twice, so a charge does not go through on both attempts. Inngest puts the same rule on its step API: "Put non-deterministic logic, such as database or API calls, inside step.run() so it runs once and its result is saved."
Long runs then meet deploys. A workflow that started three weeks ago replays against code you changed since. DBOS ships "patching and versioning" to keep old runs recoverable. Under all of it is one store the engine owns: an Event History, a journal, a Postgres system database. That store is a log of what the process did, and reading it means reading the engine.
Why agent work strains that shape
A model call is the least deterministic operation in your code. The same prompt can return different tokens twice in a row. A tool that answered a minute ago can answer with a rate limit now. The journal handles it by recording outputs, so every completion and tool result becomes a payload the replay can reuse.
That produces an accurate record of what ran. The record a colleague needs is a different thing. An agent that rewrites a checkout flow leaves a diff in the file. The reviewer wants to read that diff before the change lands. A journal says the agent called a tool and got a result. A commit says which lines changed, and a change request attaches a person's approval to them.
The pauses differ too. A payment pipeline waits milliseconds for a database write. An agent waits on someone to approve a refund. When it resumes, it needs more than a step counter: the conversation so far, the file it was halfway through, the answer the person just gave.
What survives when the computer stops
Kortix runs agent work as a session. One isolated sandbox per session. Each session has its own isolated machine and branch. It is cut from the project's default branch. The repository is cloned at /workspace, and the agent works on that branch.
Then the machine stops. The computers docs give the interval: "About 15 to 20 minutes after the last turn, Kortix stops the computer." It keeps /workspace, the branch and the conversation, and a new message wakes it. None of that is where the work lives. The starter agent prompt on Kortix on GitHub says it at the top. It sits in "an ephemeral branch of this repo, your own /workspace", and "Only what you commit + push survives."
The configuration is not in the workspace at all. The config docs say a session "runs the current config release of its base branch": kortix.yaml and the files it registers. An edit in /workspace "takes effect only when it lands on the base branch, through a merge or a push." The next session boots from the branch you merged.
Three more pieces live on the server, outside the sandbox:
- The prompt inbox. A message goes to a queue on the server, outside the computer.
send()"puts the prompt in the session's durable prompt inbox. The web app and the CLI write to the same inbox." It "resolves when the prompt is durable, not when the turn ends." - The open question. A held connector action waits on the server: "A held action expires when nobody decides within 24 hours, unless your project sets another time." The session "shows Needs you in your lists" while it waits. None of that needs the computer to stay up.
- The trigger. A trigger's
typeiscron,webhookorapp, and each run is a new session on its own cloud computer. The schedule is a file in the repo. The run is a branch.
Read together, the durable part of an agent run is a branch, a transcript and a short server-side record of what is waiting. The computer is the disposable part. That is what lets an approval survive overnight. The machine that asked is gone, and the question waits on the server.
Where the engine is still the better tool
If the work is an inventory sync, a webhook fan-out or a payment, buy the engine. These products were built for a process that keeps running with nobody between the steps: retries counted in milliseconds, thousands of executions in flight. Temporal supports "millions to billions of Workflow Executions executing concurrently". Building that on a branch per execution would cost storage you do not need.
Kortix will not replace a workflow engine, and it should not. If you already run Temporal or Restate on a billing path, keep it there. The repository is the better unit for work that pauses for a person or produces a file someone has to review. Most agent work is one or both.
The manifest behind a schedule
When the repository is the unit, the schedule is a file in it. The starter manifest declares a daily reflection trigger under triggers:, with its instruction shortened here to one line:
triggers:
- slug: harness-reflector
name: Harness reflector
type: cron
agent: harness-reflector
enabled: false
cron: "0 0 3 * * *" # 03:00 daily
timezone: UTC
prompt: Review the last 24 hours of project activity and refine the harness.
Eight fields, and the last one is the instruction: which agent runs, on what clock, in what timezone, and what it should do. The entry ships disabled, because every fire boots a sandbox. Change the expression and the review is a one-line diff. A trigger edited inside a session is a change to kortix.yaml, so it follows the session branch and its change request, and takes effect once it lands on the base branch.
Three habits make your own work survive the same way. Commit and push before you walk away, because the working copy is the only part that disappears. Keep the definition of the work in the repository, so the agent's configuration is versioned beside the code it edits. And let the change land the way every other change lands. Session work reaches main through a change request. Merge is default-deny for agents.
The two questions that decide it
Does the work pause for a person? Does anyone have to read what it produced? When either answer is yes, put the durable state in the repository, where it can be diffed and approved. When both are no, the engine earns its keep and the journal is the right record.
For the failure modes that push teams toward this question, read How to build reliable AI agent workflows with open-source Kortix.
Free to start, free to self-host. Try Kortix.