Determinism
Why the design-time/runtime split gives you durable, retryable, reproducible workflows.
The split in one sentence
The workflow body is a pure function of its inputs and step outputs. All side effects live in activities.
Why this matters
Temporal replays workflow execution from a history log. For replay to work, the workflow body must be deterministic: given the same history, it must produce the same decisions. This means no I/O, no randomness, no wall-clock time in the workflow orchestration logic itself.
Cori enforces this by design. The five activity kinds (cli, mcp_tool, code, llm, builtin) are the only places where real work happens. The workflow body just says "run step 1, pass its output to step 2, pass that to step 3."
What this buys you
Durability. If your machine crashes halfway through a ten-step workflow, restarting Cori replays from the last completed step. Nothing reruns. You continue from where you left off.
Safe retries. Activities can fail and retry without affecting the rest of the workflow. A transient API error in step 3 retries step 3; steps 1 and 2 are unaffected.
Reproducibility. Given the same inputs and the same step outputs, a workflow always produces the same final output. This makes debugging straightforward: you can re-run a trace and observe exactly what happened.
When you do want an LLM step
An llm step is appropriate when the content of the output depends on new runtime data — translating a product description that wasn't known at design time, classifying a ticket that just arrived, extracting structured data from a new document.
Use llm steps only for this. If the logic is fixed regardless of input (e.g., "filter rows where field X is non-empty"), use code. If it calls a fixed external service, use cli or mcp_tool.
Most captured workflows have zero or one llm steps. The rest are deterministic.
For contributors
The contributor-level determinism rules (no Instant::now() in the workflow body, no rand, no non-deterministic data structures) are in AGENTS.md in the repository. This page describes the mental model, not the implementation constraints.