Skip to content

Part 6 · Blueprint 33

Autonomous Agent Orchestration Platform

14 min reading · Sources · Editorial review pending

Replaying a workflow can repeat an external effect unless attempts share identity.

More
20px
Reading list
Page details

Published date · Last edited:

Draft edition. Editorial review and supplementary reading recommendations are still being completed.

Format: Architecture walkthrough. Prerequisites: the beginner bootcamp. Chapter prerequisites: Message Queues & Event Streams: Kafka vs. RabbitMQ, Idempotency Keys & Distributed Retries, Distributed Transactions: 2PC vs. Saga Orchestration.

Sixty-second mental model

Problem: Replaying a workflow can repeat an external effect unless attempts share identity.

Use: Persist decisions and reconcile tools before advancing the run.

Design boundary: Coordinate bounded agent tasks whose tool calls can affect external systems. Model tool intent and evidence explicitly; generating a plan does not authorize its execution.

Layer 1 · Intuition

Hypothetical scenario: Northwind is designing agent orchestration. Maya represents product requirements, Dev implementation and Priya reliability. The team must agree what one tool action means and which component owns the run history.

Think of a clerk following a durable checklist with bounded permissions. Separate the requester from run history, then identify the retained evidence needed after failure.

Authority
The entitled state owner.
Invariant
A rule preserved across concurrency and failures.

Architecture and worked reasoning

Design boundary: Coordinate bounded agent tasks whose tool calls can affect external systems. Model tool intent and evidence explicitly; generating a plan does not authorize its execution.

Responsibilities on the request path

Agent orchestration: responsibilities and request directionCoordinate bounded agent tasks whose tool calls can affect external systems. Model tool intent and evidence explicitly; generating a plan does not authorize its execution.Task journalPlannerTool policyEffect adapter
Coordinate bounded agent tasks whose tool calls can affect external systems. Model tool intent and evidence explicitly; generating a plan does not authorize its execution.

Workload and limiting resource

Choose a task limit of 12 model steps and at most two tool attempts per step. The declared upper count is 24 tool attempts, not unlimited autonomous work. If each step has a selected 2-second budget, twelve serial steps consume up to 24 seconds before tool latency and recovery.

Keep the units attached to each intermediate result. The assumptions above describe a hypothetical exercise, not observed vendor capacity. A real capacity decision also needs a measured service curve, skew, recovery traffic and an explicit admission policy for overload.

Mutation or publication path

Agent orchestration: mutation boundaryPersist task identity and budget. Then: Validate each proposed action against authority and policy. Then: Record effect intent and reconcile its outcome before continuing.Step 1
Persist task identity and budget.
Step 2
Validate each proposed action against authority and policy.
Step 3
Record effect intent and reconcile its outcome before continuing.
Persist task identity and budget. Then: Validate each proposed action against authority and policy. Then: Record effect intent and reconcile its outcome before continuing.
  1. Persist task identity and budget.
  2. Validate each proposed action against authority and policy.
  3. Record effect intent and reconcile its outcome before continuing.

Observation and recovery path

Agent orchestration: observation boundaryRecover a task from journaled observations. Then: Distinguish model text from tool execution evidence. Then: Stop or escalate when the next safe action is unknown.Step 1
Recover a task from journaled observations.
Step 2
Distinguish model text from tool execution evidence.
Step 3
Stop or escalate when the next safe action is unknown.
Recover a task from journaled observations. Then: Distinguish model text from tool execution evidence. Then: Stop or escalate when the next safe action is unknown.
  1. Recover a task from journaled observations.
  2. Distinguish model text from tool execution evidence.
  3. Stop or escalate when the next safe action is unknown.

Failure that changes the decision

Hypothetical scenario: An agent repeats an external action after losing the tool response. Stable intent identity and adapter reconciliation must prevent an unexamined second effect.

Attempt this decision before reading the explanation

Does a model saying the task is finished prove completion?

No. Completion requires the task acceptance checks and evidence of required effects. Treat model statements as proposals/observations to validate, not authoritative receipts.

Supporting mechanism analysis

Hypothetical scenario: Northwind. Maya represents product, Dev implementation and Priya reliability. The following workflow develops the underlying mechanism.

Before you continue: The response timed out after dispatch. Does that establish that the remote update failed?

The missing response leaves the outcome uncertain. The remote system may have committed before communication failed; a new operation identity can produce a duplicate effect.

This preserves the uncertainty. Inspect supported status or idempotency behavior, retain the operation identity and expose an unresolved outcome when the remote contract cannot settle it.

A model-driven application mixes several activities: constructing a request, interpreting a response, choosing a tool, waiting for approval and changing an external record. Treating all of that as one function hides the boundaries that matter when execution stops. A local variable can say “sending,” while the document service has already accepted the change. Conversely, a generated sentence saying “updated” can exist before any authorized write was attempted.

The obvious recovery procedure is to rerun the request from its beginning. That can repeat a model call, obtain a different proposal, consume another attempt and resend an already accepted operation. Another tempting procedure is to trust the latest chat message as the complete state. A message is useful evidence about what was said; it does not identify every pending action, approval version or observation needed for recovery.

Separate those concerns before choosing a framework. Store the approved document revision, proposal identity, remaining task allowance, requested action and confirmed result as different facts. A transition into a confirmed state requires an observation that satisfies the application’s confirmation rule. A timeout instead moves the action into an unresolved state with a reconciliation path.

LangGraph’s Graph API describes workflows using shared state, nodes and edges. Nodes perform work and return updates; edges select subsequent work. A reducer determines how updates to a state field combine. This makes the update rule part of the workflow’s meaning, rather than an incidental assignment in a long procedure.

For Northwind, a proposed design stores one current proposal revision, a set of evidence references and a separate action ledger. Replacing the proposal and appending evidence are different operations. If two branches produce evidence simultaneously, a merge keyed by source identity can be preferable to concatenating arbitrary strings. If two branches propose conflicting replacements, an explicit resolution step is easier to reason about than silently selecting whichever result arrives last.

The reducer is therefore a decision about information. Ask whether order matters, whether duplicate observations should count twice and whether incompatible revisions can coexist. An append-only list preserves history, but it can also repeat the same observation after a retry. A single replacement field stays compact, but can erase evidence of disagreement. Choose each field’s behavior from the reader or decision that consumes it.

The diagram is a proposed application model, not a claim that these states are built into LangGraph. “Unresolved” is a useful state because it permits inspection without granting permission to repeat the effect. Its outgoing transition must specify the lookup, identity check or human decision needed to establish the next action.

Define the meaning of each saved observation in your application. A durable “request prepared” entry can identify what was about to be sent. A durable “response accepted” entry can identify a result the worker observed. There is still an interval between the external effect and the second entry. The document service must supply its own supported operation identity, version condition or authoritative lookup if that interval is to be reconciled automatically.

It helps to divide a node at a meaningful boundary rather than at every line of computation. An independently inspectable proposal is a useful boundary. So is a recorded approval bound to that proposal. A giant node that generates, approves and writes hides several different responsibilities, while excessively fine boundaries enlarge the history without necessarily improving the recovery decision.

The completed prefix takes 4 + 6 + 2 = 12 seconds. The first write attempt adds 3 seconds, so the interruption occurs after 12 + 3 = 15 seconds of attempted work. If the same prefix and one write attempt were blindly repeated, another 15 seconds would be attempted. The cumulative total would be 15 + 15 = 30 seconds, and the external write could have been submitted twice.

Now assume the service supports an authoritative lookup by the stable action identity, and that lookup takes a chosen 1 second. If it confirms the original write, recovery uses 1 additional second and sends no replacement write: 15 + 1 = 16 seconds of cumulative work. If it establishes that the operation did not take effect and permits a safe retry, the extra work is 1 + 3 = 4 seconds, for 15 + 4 = 19 seconds. An inconclusive lookup gives neither conclusion; the workflow remains unresolved.

These totals separate avoided prefix work from effect safety. Reusing 12 seconds of saved computation is useful, but it does not prove whether the first write happened. The service contract supplies that evidence. If the lookup cannot establish absence safely, the 19-second branch is unavailable, regardless of how attractive the estimate looks.

The Northwind lost-response incident remains hypothetical. It illustrates an additional boundary the runtime cannot infer from a chat transcript: an external service’s accepted effect may outlive the worker that requested it. Evaluate a runtime by examining its actual persistence contract and your tool boundary together, not by treating the word “durable” as an end-to-end guarantee.

A graph is useful when the application must expose waiting states, conditional branches or recovery decisions to another person or service. A short, side-effect-free transformation can be clearer as an ordinary function. The point is not to maximize node count. It is to make decisions that survive interruption explicit enough to inspect.

There is also a real choice between a prescribed workflow and model-selected next actions. A workflow can constrain which transitions exist while allowing a model to propose content inside a node. Dynamic planning can handle less predictable tasks, but it creates more possible paths to evaluate. Both still need a task budget, action authority and an observable stopping condition.

For parallel work, distinguish latency from total work. Collecting independent evidence concurrently can shorten a critical path while leaving the number of model calls unchanged. Joining the branches adds a question: which outputs are sufficient, and what happens if one never arrives? A visible join policy is part of the design, not something a state diagram resolves automatically.

Layer 3 · Internals

Trade-offs and limits

ApproachProvidesRequires
Durable workflow historySupports resuming a run from recorded decisions and tool evidence.History growth and replay compatibility need management.
Ephemeral request loopHas fewer persistent components for short disposable work.A crash loses progress unless an independent authority reconstructs it.

Recovery decision

Hypothetical scenario: An agent repeats an external action after losing the tool response. Stable intent identity and adapter reconciliation must prevent an unexamined second effect.

No. Completion requires the task acceptance checks and evidence of required effects. Treat model statements as proposals/observations to validate, not authoritative receipts.

Write your design before revealing the review

Does a model saying the task is finished prove completion?

Evidence you can explain in your own design

Drafts and self-review are stored only in this browser. They are separate from reading completion.

Compare your decision

No. Completion requires the task acceptance checks and evidence of required effects. Treat model statements as proposals/observations to validate, not authoritative receipts.

An agent repeats an external action after losing the tool response. Stable intent identity and adapter reconciliation must prevent an unexamined second effect.

Check your understanding

Does a model saying the task is finished prove completion?

No. Completion requires the task acceptance checks and evidence of required effects. Treat model statements as proposals/observations to validate, not authoritative receipts.

How would you recover from this failure: An agent repeats an external action after losing the tool response. Stable intent identity and adapter reconciliation must prevent an unexamined second effect.

Start with the exact boundary that failed. Persist task identity and budget. Validate each proposed action against authority and policy. Record effect intent and reconcile its outcome before continuing. Then recover evidence through the observation path: Recover a task from journaled observations. Distinguish model text from tool execution evidence. Stop or escalate when the next safe action is unknown. Preserve the distinction between a confirmed state change and an unavailable response.

Which assumption in the worked calculation would a burst or concentrated tenant invalidate first?

Choose a task limit of 12 model steps and at most two tool attempts per step. The declared upper count is 24 tool attempts, not unlimited autonomous work. If each step has a selected 2-second budget, twelve serial steps consume up to 24 seconds before tool latency and recovery. Recompute the affected resource rather than multiplying unrelated storage and network budgets by the same factor. Coordinate bounded agent tasks whose tool calls can affect external systems. Model tool intent and evidence explicitly; generating a plan does not authorize its execution.

Which component in this topology could be removed from a smaller first deployment?

Task journal, Planner, Tool policy, Effect adapter name responsibilities, not a requirement for separate processes. Co-locate responsibilities when their transaction, trust and capacity boundaries permit it. Persist task identity and budget.

What evidence must a caller have before relying on the observation path?

Recover a task from journaled observations. Distinguish model text from tool execution evidence. Stop or escalate when the next safe action is unknown. No. Completion requires the task acceptance checks and evidence of required effects. Treat model statements as proposals/observations to validate, not authoritative receipts.

45-minute interview rubric

  1. 00–05: scope tool action and run history.
  2. 05–12: identify the limiting resource and derive the domain workload above, retaining units and assumptions.
  3. 12–28: draw run history, numbered writes and reads.
  4. 28–40: challenge recovery: Persist decisions and reconcile tools before advancing the run.
  5. 40–45: defend run_id placement, observations and remaining assumptions.

Go deeper

Decision log

Persist decisions and reconcile tools before advancing the run.

Preserve tool action identity and run history ownership.

Revisit changed workload, observations or recovery objectives.