Deterministic AI agent workflows: record, compile, replay
An agent that thinks about every step is hard to repeat. A deterministic workflow runs the steps as code, with a model only where a choice is needed. Here is how a recorded run becomes one, what stays with the model, and what we measured.
What deterministic means here
The same steps run in the same order with the same tools every time. The model is not asked to plan them again. It is called only at steps that need judgment, such as a classification or a short written sentence. Totals, counts and currency conversions are not left to the model: code recomputes them on every run.
From a recording to a workflow
- Record. The agent does the task once through Hotpath's MCP proxy. Every tool call is written to a trace.
- Compile. The repeated path becomes steps. Steps that need a choice are marked for the model; the rest are plain code.
- Replay. The workflow runs on new data. Where the data changes shape, the run stops before anything is sent and goes back to the agent.
What we measured
- On Claude, 30 of 30 replays on new data finished with no fallback, across two tasks (synthetic data).
- Same-data runs make 0 model calls. New-data runs make 1 call to the cheap model.
- The replay noticed 8 of 8 kinds of data change we tested (renamed field, removed field, type change, new currency, empty statement, error payload, extra nesting, renamed tool), on two models, and sent nothing on data it was not built for.
- Totals and counts: on a finance task, a small free model went from 0 of 20 to 20 of 20 correct reports once the code did the sums.
A workflow is deterministic in its steps, not in its answers. A bad recording is replayed the same bad way every time.
Where a deterministic workflow loses
- The recording. A free 1.7B model doing everything passed 54% of 99 runs; where the recording was good, 87%.
- Fallbacks. A fallback costs about 33 times a finished replay.
- Recovery quality after a data change was measured on Claude for one kind of change only (3 of 3 runs).
- We do not claim that a replay never sends a wrong report. It checks every report against the data before it is sent.
Try the loop
Run npx @hotpathrun/cli demo in an empty folder to see record, learn and replay on the bundled demo task. Numbers and caveats: the claims file in the repository.
Try it on your own task.
The CLI is free with an account. No card. Run npx @hotpathrun/cli demo in an empty folder.