Agent workflows: from a request to a verified result
How do I design the path from a request to a result someone can use and trust?
An agent workflow is the path from a request to a result someone can use. The interesting part is not how many agents take part. It is how the system decides what to do, where it stops to check, how it recovers from each kind of failure, and what it hands over at the end.
Start with the agent fundamentals if the terms are new. The mechanics of a single loop (evidence gates, checkpoints, replay protection) are in skills and harnesses; this article works one level up, on the shape of the whole process. Framework-specific notes are in Current options.
Key points
- Decide where each decision belongs: in fixed code (predictable steps, permissions, checks) or in the model (choices that depend on what it observes).
- Pick a pattern for a reason: chaining, routing, parallel work, a single tool-using agent, coordinator–workers, or generator–evaluator. They are options, not a maturity ladder.
- Put a gate between stages: each stage produces something checkable, and the next stage starts only when the check passes.
- Budget the whole task (steps, time, cost) across resumptions, and stop on repeated failure without new evidence.
- Recover according to the failure type; never blindly repeat an action whose effect is unknown.
- End with a handoff that states the artifact, the checks actually run, and what remains open.
Choose where decisions belong
A fixed workflow follows predefined transitions, even if some steps call a language model. An agent loop lets the model choose its next action from what it observes. Many useful systems combine them: deterministic code controls access, ordering and checks, while an agent investigates an unexpected failure inside one stage. [1]
| Pattern | Use it when | Example | Main failure to watch |
|---|---|---|---|
| Chaining | Later steps need earlier outputs | Extract source claims, check them, then draft | An early error flows into every later step |
| Routing | Inputs need different procedures | Send a documentation issue to a documentation workflow | Misclassification selects the wrong procedure |
| Parallel work | Subtasks are independent and can be merged | Check separate reference lists | Duplicate effort; incompatible outputs |
| One agent with tools | The next action depends on what it discovers | Investigate why a link check fails | Repeated attempts without new evidence |
| Coordinator and workers | The split is only known after inspection | Assign independent chapter reviews | Coordination cost and integration gaps |
| Generator and evaluator | A useful acceptance rubric exists | Draft an explanation, then check each claim | The evaluator rewards plausible text over correctness |
Three questions usually decide the pattern:
- Can I write the steps down in advance? If yes, use a fixed chain or routing and let the model fill in content, not control flow.
- Are the subtasks independent? Only then does parallel work pay; otherwise integration cost eats the gain.
- Is there an independent check? A generator–evaluator loop works when the evaluator can test something the generator cannot fake, such as running tests or matching a cited source. Two models sharing the same blind spot do not make an independent check. [1, 3]
Follow the whole path, with gates
The normal route is request → task contract → plan → tool work → verification → handoff. Each arrow is a gate: the next stage starts only when the current one has produced something checkable.
| Stage | Produces | Gate to the next stage |
|---|---|---|
| Task contract | Goal, inputs, allowed actions, acceptance criteria | The result and the permitted actions are unambiguous |
| Plan | Small steps and their dependencies | The next action is executable and in scope |
| Tool work | A changed artifact and action results | The change exists in the environment, not only in the transcript |
| Verification | Check results tied to the current artifact revision | Required checks pass, or the gap is explicitly recorded |
| Handoff | Artifact location, evidence, open items | Another person or run can act on it without asking |
When verification fails, return to the relevant work step with the failure evidence instead of restarting everything. When information or authority is missing, preserve progress and name the missing input. The plan is working state: revise it when observations change the problem, and do not confuse ticked plan items with met acceptance criteria. Repository instructions and readable project documentation help an agent find the right commands and constraints at every stage. [2]
Where human approval belongs. Put approval at genuinely new boundaries: publishing, sending, deleting, spending, or acting outside the agreed scope. Asking for approval on every read trains people to click “yes” without reading, which is worse than no gate at all. Work already authorized by the task contract should proceed without interruption.
Budgets. Set a total budget for steps, wall-clock time and spend that persists across pauses and resumptions; a per-call limit that resets on every resume does not bound anything. Add a “stuck” rule, for example stop after the same check fails three times with no new information, and report what would unblock it.
Worked example: repair a chapter’s reading links
Request: “Fix broken reading links in this chapter and explain any unresolved sources.”
- Contract. Chapter file, allowed files (that file only), expected output (a reviewable change plus a short report), and the link-check command. Editing the chapter is authorized; publishing the site is not.
- Inspect the starting state. Read repository instructions, check for others’ uncommitted changes, and list the exact failing links. Gate: a concrete list exists.
- Collect evidence. Open each candidate source and match title, authors and version before choosing a replacement. A similarly named page is not enough. Gate: every replacement has a matched source, or is marked unresolved.
- Apply a focused change. Update the link and any sentence the new source makes inaccurate. Gate: the diff touches only the allowed file.
- Verify. Run the link check and content checks, then inspect the diff. A successful HTTP response does not prove the link points to the intended work. Gate: checks pass on this revision.
- Hand off. Report the changed file, the checks actually run with their results, and the unresolved sources.
A second worker could verify a different chapter in parallel. Two workers should not rewrite the same paragraph at once without an integration step, and a reviewer does not replace the link check.
Recover according to the failure
| Observation | Failure type | Next action |
|---|---|---|
| A source is temporarily unreachable | Transient | Retry within budget with back-off, or record it as unavailable |
| A required file or dependency is missing | Missing input | Find the documented input or report the precise requirement |
| A test fails after an edit | Defect in the work | Read the failure and repair the relevant change |
| A write timed out | Unknown outcome | Check whether it took effect before repeating it; use an idempotency key where available |
| The next action exceeds the authorized scope | Authority | Prepare the reviewable result and ask for the specific permission |
| Attempts produce no new evidence | Stuck | Stop, preserve state, and explain what would unblock it |
The “unknown outcome” row is the one that causes real damage: a payment, message or ticket created twice. A checkpoint records how far the workflow got, but it is not proof that a remote action happened exactly once. The mechanics (stable action identities, receipts, reconciling before retry) are shown in runnable form in part 2. Bind saved check results to the artifact revision they examined, so an edit cannot inherit an old “pass”.
A handoff someone can use
End every run, successful or not, with a handoff in a fixed shape. For example:
Code · 6 lines
Result: chapter links repaired (2 of 3); 1 unresolved.
Artifact: content/chapter-04.md (changed lines 112, 187)
Checks run: link-check -> pass; content-check -> pass (both on the final revision)
Unresolved: [7] publisher page removed; no archived copy with matching title found.
Not done (out of scope): site build and deployment.
Next action: decide whether to cite the preprint instead of the removed page.The handoff names what was verified and how, separates “not done” from “failed”, and gives a single next action. It is short because detail lives in the artifact and the logs, reachable through the paths it names.
Evaluate the workflow, then improve it
Build a small evaluation set from your real work: ordinary tasks, ambiguous inputs, missing sources, tool failures and interrupted runs. Grade the final environment (the file, the ticket, the reservation), not the transcript; an agent saying it fixed a link is not a fixed link. [4] Record accepted results, total cost, elapsed time, retries and human corrections, and keep the cases you tune on separate from the cases you judge on. The model-evaluation guide explains how to read pass rates on small samples and why repeated-run reliability differs from best-of-several success.
Then change one thing at a time: a clearer input, a better tool, a stronger check, or a smaller handoff. Add a worker or an evaluator only when a measured bottleneck calls for it. Use the tool-selection guide to choose an interface or framework once you know which responsibilities it must carry.
Current options, checked 6 November 2026
- Workflow frameworks with persistence. LangGraph documents checkpointers that persist a thread’s graph state and support conversation continuity, human-in-the-loop workflows, time travel and fault tolerance; the application still decides how external side effects are retried. [5] Other frameworks are compared in choosing agent tools.
- Long-running work across sessions. Recent engineering reports describe incremental progress files and explicit handoffs so a later session can continue from a coherent state, and separating planning, generation and evaluation roles. [3, 6]
Further reading
- Anthropic, Building effective agents: the workflow pattern catalog this article builds on. [1]
- Anthropic, Demystifying evals for AI agents: designing tasks, graders and transcripts for agent evaluation. [4]
- LangChain, Persistence: a concrete checkpointing model to compare your own design with. [5]
- Anthropic, Effective harnesses for long-running agents: handoffs between sessions in practice. [6]
References
Primary engineering guidance and documentation, accessed 6 November 2026:
- Anthropic, “Building effective agents,” 19 December 2024. Workflow patterns.
- Ryan Lopopolo, “Harness engineering: leveraging Codex in an agent-first world,” OpenAI, 11 February 2026. Repository and environment design.
- Prithvi Rajasekaran, “Harness design for long-running application development,” Anthropic, 24 March 2026. Planner, generator and evaluator roles.
- Anthropic, “Demystifying evals for AI agents,” 9 January 2026. Evaluation guidance.
- LangChain contributors, “Persistence,” LangGraph documentation. Checkpoints and resumption.
- Anthropic, “Effective harnesses for long-running agents,” 26 November 2025. Incremental work and handoffs.