Full search page →

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?

8 min readUpdated Sources checked 繁體中文

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]

PatternUse it whenExampleMain failure to watch
ChainingLater steps need earlier outputsExtract source claims, check them, then draftAn early error flows into every later step
RoutingInputs need different proceduresSend a documentation issue to a documentation workflowMisclassification selects the wrong procedure
Parallel workSubtasks are independent and can be mergedCheck separate reference listsDuplicate effort; incompatible outputs
One agent with toolsThe next action depends on what it discoversInvestigate why a link check failsRepeated attempts without new evidence
Coordinator and workersThe split is only known after inspectionAssign independent chapter reviewsCoordination cost and integration gaps
Generator and evaluatorA useful acceptance rubric existsDraft an explanation, then check each claimThe evaluator rewards plausible text over correctness

Three questions usually decide the pattern:

  1. 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.
  2. Are the subtasks independent? Only then does parallel work pay; otherwise integration cost eats the gain.
  3. 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.

StageProducesGate to the next stage
Task contractGoal, inputs, allowed actions, acceptance criteriaThe result and the permitted actions are unambiguous
PlanSmall steps and their dependenciesThe next action is executable and in scope
Tool workA changed artifact and action resultsThe change exists in the environment, not only in the transcript
VerificationCheck results tied to the current artifact revisionRequired checks pass, or the gap is explicitly recorded
HandoffArtifact location, evidence, open itemsAnother 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.

Request: “Fix broken reading links in this chapter and explain any unresolved sources.”

  1. 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.
  2. Inspect the starting state. Read repository instructions, check for others’ uncommitted changes, and list the exact failing links. Gate: a concrete list exists.
  3. 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.
  4. Apply a focused change. Update the link and any sentence the new source makes inaccurate. Gate: the diff touches only the allowed file.
  5. 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.
  6. 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

ObservationFailure typeNext action
A source is temporarily unreachableTransientRetry within budget with back-off, or record it as unavailable
A required file or dependency is missingMissing inputFind the documented input or report the precise requirement
A test fails after an editDefect in the workRead the failure and repair the relevant change
A write timed outUnknown outcomeCheck whether it took effect before repeating it; use an idempotency key where available
The next action exceeds the authorized scopeAuthorityPrepare the reviewable result and ask for the specific permission
Attempts produce no new evidenceStuckStop, 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

References

Primary engineering guidance and documentation, accessed 6 November 2026:

  1. Anthropic, “Building effective agents,” 19 December 2024. Workflow patterns.
  2. Ryan Lopopolo, “Harness engineering: leveraging Codex in an agent-first world,” OpenAI, 11 February 2026. Repository and environment design.
  3. Prithvi Rajasekaran, “Harness design for long-running application development,” Anthropic, 24 March 2026. Planner, generator and evaluator roles.
  4. Anthropic, “Demystifying evals for AI agents,” 9 January 2026. Evaluation guidance.
  5. LangChain contributors, “Persistence,” LangGraph documentation. Checkpoints and resumption.
  6. Anthropic, “Effective harnesses for long-running agents,” 26 November 2025. Incremental work and handoffs.
  • #agents
  • #workflows
  • #engineering