loading…
Use models inside a control flow that application code defines in advance.
A deterministic workflow may contain probabilistic model steps, but the sequence, branches, retry rules, and approval points are encoded by the application.
Classify → Route → Retrieve → Draft → Validate → Human approval → Execute
| Shape | Use |
|---|---|
| Sequential chain | Each validated output becomes the next input |
| Router | Send requests to different prompts, models, or business paths |
| Parallel fan-out / fan-in | Run independent analyses, then aggregate |
| Map-reduce | Process many documents or records, then summarize results |
| State machine | Represent explicit allowed transitions and recovery paths |
Long workflows should persist state outside the model context. Store completed steps, artifacts, retry counts, approvals, and idempotency keys. If a worker crashes, the system resumes from a checkpoint instead of repeating every action.
They make uncertainty local. A model may classify or draft probabilistically, while the surrounding transitions, permission checks, and side effects remain deterministic.