The Conductor Pattern - Making a Multi - Agent Pipeline Stop Falling Over
How a Planner/Researcher/Coder/Reviewer product went from a racy, silent-failing chain of HTTP calls to a durable workflow that can't lose a step, ship an un-reviewed bug, or hang on a slow agent.
𝘐𝘴𝘴𝘶𝘦 #04 | 𝘛𝘢𝘨𝘴: 𝘮𝘶𝘭𝘵𝘪-𝘢𝘨𝘦𝘯𝘵 𝘴𝘺𝘴𝘵𝘦𝘮𝘴, 𝘰𝘳𝘤𝘩𝘦𝘴𝘵𝘳𝘢𝘵𝘪𝘰𝘯, 𝘥𝘶𝘳𝘢𝘣𝘭𝘦 𝘦𝘹𝘦𝘤𝘶𝘵𝘪𝘰𝘯, 𝘛𝘦𝘮𝘱𝘰𝘳𝘢𝘭, 𝘳𝘦𝘭𝘪𝘢𝘣𝘪𝘭𝘪𝘵𝘺, 𝘰𝘣𝘴𝘦𝘳𝘷𝘢𝘣𝘪𝘭𝘪𝘵𝘺, 𝘓𝘓𝘔𝘖𝘱𝘴
You have an AI product with 4 specialised agents, a Planner, a Researcher, a Coder, and a Reviewer. The Planner breaks down the task. The Researcher pulls context. The Coder implements. The Reviewer catches bugs. Looks simple on paper. In production, it’s falling apart.
Here’s what’s happening:
The Researcher sometimes returns before the Planner finishes → Coder gets incomplete context.
The Reviewer flags issues → but there’s no retry loop, so
bugs ship anyway.One agent timeout hangs the entire pipeline for 30 seconds.
You have no visibility into which agent failed or why.
TL;DR:
Four agents (Planner → Researcher → Coder → Reviewer) work on paper but fall apart in production: a race between Researcher and Planner starves the Coder of context, the Reviewer's findings go nowhere because there's no loop back to the Coder, one slow agent hangs the whole pipeline for 30s, and nobody can tell which agent failed or why.
The fix is not a better prompt or a bigger model. It's treating the pipeline as a durable, stateful workflow rather than a chain of stateless calls, and putting a single orchestrator in charge of ordering, retries, timeouts, and telemetry.
We build it on Temporal (durable execution - info), with each agent as an activity, an explicit DAG(Directed Acyclic Graph - info) that makes ordering a data dependency instead of a timing coincidence, a bounded Coder⇄Reviewer review loop (max 3, then escalate never ship silently), per-activity timeouts + bulkheads so one hung agent can't block the pipeline, and OpenTelemetry spans over the whole run.
Estimated cost is dominated by LLM tokens, not infrastructure: ~$8–12K/month at pilot ~15K tasks and ~$155–245K/month at production ~300K tasks with model routing and prompt caching the two biggest levers, plausibly halving the token bill.
The orchestrator (Temporal Cloud - info) is a rounding error next to the model spend: ~$100/month pilot, ~$1.2K/month production.
Assumptions:
Mid-market B2B SaaS scale - ~10,000 tasks/day in production (each task = one full pipeline run: Planner + Researcher + Coder + up to three review iterations), ~500/day at pilot.
Cloud-agnostic core (Temporal is portable) with surrounding infra deployed on AWS us-east-1, Temporal Cloud (managed) rather than self-hosted Cassandra to start.
No HIPAA/PCI/GDPR-hard regime, but customer code is sensitive IP so encryption and tenant isolation are in scope (general SOC 2 posture).
No hard budget ceiling, cost-conscious scale-up. Pricing estimates are shown as per July-2026 rates.
1. The Challenge
The product works in the demo and dies in production, and the reason is almost boringly common. The four agents were wired together as a sequence of direct calls, each one awaiting the next, with the "pipeline" being nothing more than the call stack of whatever service kicked it off. That's fine when every agent returns quickly and correctly. It is a liability the moment reality intrudes and reality always intrudes.
The symptoms in the problem statement are four faces of the same root cause, there is no component that owns the run. Nobody is holding the state of "where are we, what depends on what, what do we do if this step misbehaves". Ordering is implicit in the code path, so it breaks under concurrency. Recovery is implicit in nobody, so it doesn't happen. Failure is scoped to the whole call, so one bad step poisons everything, and because the run has no durable identity, there's nothing to attach a trace to.
Concretely, here is what's going wrong and why:
The Researcher races the Planner. Someone parallelised calls for latency, but the Coder consumes both the plan and the research. When the Researcher returns first (or the Planner is still streaming its breakdown), the Coder is handed partial context and implements against half a spec. This is a data-dependency being enforced by wall-clock timing - which is to say, not enforced at all.
The Reviewer is a dead end. It dutifully finds bugs and writes them down, but there is no path from "Reviewer found problems" back to "Coder fixes them." The verdict is advisory. Bugs ship because the only thing downstream of the Reviewer is the exit.
One slow agent hangs everyone. With no per-step timeout, a single agent stuck on a slow model call or a wedged tool blocks the entire synchronous chain - the reported 30 seconds hang. The pipeline shares fate with its slowest participant, and there's no bulkhead to contain the damage.
The run is invisible. When a task fails, the team gets "the pipeline errored" and a stack trace pointing at glue code. Which agent ? On which input ? After how many tokens? On the first attempt or the third ? Debugging is archaeology.
The business context sharpens all of this. This is a coding product, the output is code a customer will run so a silently shipped, un-reviewed bug isn't a cosmetic defect, it's the core promise broken. And agentic coding is expensive per run, so "just retry everything aggressively" and "run the strongest model at every step" are not free reliability strategies, instead they're how the token bill triples. The design has to be reliable and disciplined about where it spends.
2. The Solution at a Glance
The core bet, Stop modelling the pipeline as a chain of stateless calls and model it as a single durable workflow, executed by an orchestrator that owns ordering, retries, timeouts, and observability.
We use a durable execution engine - Temporal, as that orchestrator. Each agent becomes an activity (a unit of work Temporal schedules, times out, retries, and records). The pipeline's control flow the DAG (Directed Acyclic graph - one path travel, no path to previous node), the review loop, the fallbacks lives in a single workflow definition written as ordinary code, and Temporal persists every step to an event history so the run has a durable identity that survives worker crashes, deploys, and restarts. This is deliberately not a framework that's clever about agents, it's a framework that's relentless about not losing work. The "agent-ness" stays in your code, the durability comes from underneath.
It ships in three phases, mirroring the way you'd actually earn trust in a system like this:
Phase 1 : Stabilise (the MVP). Encode the pipeline as an explicit DAG so ordering is a data dependency. Add per-activity timeouts and heartbeats. Add the bounded Coder⇄Reviewer loop with a hard cap and human escalation. This alone kills three of the four production fires (race, dead-end reviewer, pipeline-wide hang). Optimise for accuracy here, run strong models everywhere and don't worry about the token bill yet.
Phase 2 : See (Enhanced). Wrap the whole workflow in OpenTelemetry, stand up per-agent dashboards and an evaluation harness, and start alerting on SLOs. Now "which agent failed and why" is a dashboard query, not an investigation. This phase turns the fourth fire into instrumentation.
Phase 3 : Tune (Advanced). With the system trusted and observable, invert the priority. Introduce model routing (cheap model for easy stages, strong model for the Coder), prompt caching across review iterations, human-in-the-loop for escalations, and multi-region posture. This is where the cost curve bends without sacrificing the reliability you earned in Phase 1.
3. System Architecture
A task enters through the API Ingress and is handed to the Temporal Frontend, which starts a workflow execution on a task queue. That workflow the conductor is the only component that knows the shape of the whole run. It never calls an LLM itself. It dispatches activities onto task queues, and the Agent Worker Pool (ordinary containers running your agent code on AWS Fargate) polls those queues and executes the Planner, Researcher, Coder, and Reviewer. Every activity's inputs, outputs, retries, and timings are written to the Event History (Temporal's durable store), which is what lets a run survive a worker dying mid-flight. A fresh worker replays the history and picks up exactly where the last one stopped. Larger artifacts generated code, long research dossiers are offloaded to an S3 artifact store and passed between agents by reference, so the workflow state stays small.
All four agents reach their model through a single LLM Gateway / Model Router, which is where per-stage model selection, retries against the provider, and prompt caching live. Behind it sit the Claude models, Opus 4.8 for the Coder, Sonnet 5 for Planner and Reviewer, Haiku 4.5 for the Researcher's cheap sub-tasks. The Researcher additionally reaches its own retrieval tools, a Web Search API and a pgvector vector store on RDS. Finally, every component emits OpenTelemetry spans, metrics, and structured logs correlated by workflow id into a Collector that fans out to a Grafana stack (Tempo for traces, Prometheus for metrics, Loki for logs, plus alerting). The telemetry deliberately runs alongside the data flow, not through it.
The design principles driving the shape:
The workflow is the single source of truth for control flow. Ordering, branching, retries, and the review loop are all expressed in one place, as code, and persisted. There is exactly one component you look at to understand "what happens in a run."
Ordering is a data dependency, never a timing coincidence. The Coder activity's inputs are the outputs of the Planner and Researcher activities. The workflow can't invoke it until both exist, regardless of who finished first.
Statelessness at the edges, durability at the centre. Workers are disposable and hold no run state. All state lives in the durable Event History. This is what makes horizontal scaling and crash recovery trivial.
Failure is isolated per step. Each activity has its own timeout, retry policy, and (via separate task queues) its own resource pool, so one misbehaving agent is contained.
4. Deep Dive: Key Components
4.1 The workflow as conductor — fixing the race
The race between Researcher and Planner is fixed by refusing to let it exist. In the workflow, the Coder's inputs are the resolved results of the Planner and Researcher activities:
@workflow.defn
class SolveTask:
@workflow.run
async def run(self, req: TaskRequest) -> Result:
plan = await workflow.execute_activity(
plan_task, req,
start_to_close_timeout=timedelta(seconds=45),
retry_policy=RetryPolicy(maximum_attempts=3),
)
# Researcher can start as soon as the plan's sub-questions exist,
# but the Coder is gated on BOTH plan and context — by data, not by clock.
context = await workflow.execute_activity(
research, plan.subquestions,
start_to_close_timeout=timedelta(seconds=60),
retry_policy=RetryPolicy(maximum_attempts=3),
)
code = await self._code_and_review(plan, context) # §4.2
return code
The engineering decision here is to express the DAG as ordinary await-structured code inside a deterministic workflow, rather than as a set of independently-triggered handlers. Because Temporal replays this code deterministically against the event history, the ordering is guaranteed and survives restarts the Coder line simply cannot execute before both upstream results are materialised.
The alternative that could have been considered but does not work for the purpose here. Choreography via a message bus (e.g., SQS/EventBridge or Kafka, where each agent emits an event the next agent subscribes to). It scales beautifully and decouples teams, but it pushes ordering into emergent, distributed behaviour, the exact property that produced the race in the first place. With choreography, "the Coder must have both plan and context" becomes a correctness invariant you enforce by hand across independent consumers, with no single place to read the run's logic. For a four-agent pipeline with real data dependencies and a feedback loop, centralised orchestration is the right call. We'd revisit choreography only if the agent graph grew large and the teams owning each agent needed to deploy independently.
4.2 The bounded review loop — so bugs stop shipping
The Reviewer's dead-end is fixed by giving its verdict somewhere to go: back to the Coder, in a bounded loop with a hard iteration cap and a loud escalation when the cap is hit. This is the single most important behavioural change in the design, because it's the one that directly protects the product's promise.
async def _code_and_review(self, plan, context, max_iters=3):
code = await workflow.execute_activity(implement, (plan, context), ...)
for i in range(max_iters):
verdict = await workflow.execute_activity(review, code, ...)
if verdict.approved:
await workflow.execute_activity(commit_artifact, code, ...)
return code
code = await workflow.execute_activity(
revise, (code, verdict.comments), ...) # feed the review BACK
# cap reached without approval — do not ship
await workflow.execute_activity(escalate_to_human, (code, verdict), ...)
raise ApplicationError("review budget exhausted", non_retryable=True)
Two decisions matter here. First, the loop is bounded and terminates loudly: without a cap, a Coder and Reviewer that disagree can ping-pong forever, and each round is a full (expensive) Opus + Sonnet exchange an unbounded loop is both a cost bomb and a latency bomb. Second, the terminal branch escalates rather than ships: when the system can't reach a clean review within budget, it routes to a human queue and fails the workflow explicitly, so an un-approved change never silently reaches the customer. The alt in the diagram is the whole point, there is no path from "not approved" to "delivered."
The alternative we rejected: letting the Coder self-critique in a single mega-prompt (one model call that writes, critiques, and revises internally). It's cheaper and lower-latency, but it collapses the independent reviewer signal the model grading its own work is exactly the failure mode a separate Reviewer exists to prevent and it gives you no per-step observability into why something failed review. We keep Coder and Reviewer as distinct activities so the verdict is an auditable artifact and the loop is inspectable.
4.3 Timeout and failure isolation: so one slow agent can't hang the pipeline
The 30 second hang comes from a shared, unbounded, synchronous call. The fix has three layers. Per-activity timeouts (StartToCloseTimeout, and ScheduleToCloseTimeout to bound total time including retries) make a slow agent a first-class event the workflow handles rather than a blocking wait when the Researcher blows its 60s budget, the workflow gets a timeout it can react to (retry, fall back to degraded context flagged for the Reviewer, or fail that branch), while everything else keeps moving. Heartbeats let genuinely long LLM calls signal liveness so they aren't killed prematurely, while still detecting a truly wedged worker within seconds. Bulkheads a separate task queue and worker pool per agent mean a saturated Coder pool (the expensive, slow one) can't starve Reviewers or Planners, each agent scales and fails independently.
We also put a circuit breaker at the LLM Gateway: if the model provider starts erroring or slowing, the breaker trips and the workflow fails fast with a clear signal instead of every activity independently burning its full timeout budget against a degraded upstream.
The alternative we rejected: a single global pipeline timeout. It's one line of config and it does prevent the infinite hang but it's a blunt instrument. It can't distinguish "the Coder is legitimately working through a hard task" from "the Researcher is wedged," it gives no per-step fallback, and it throws away the whole run's work when it fires. Per-activity timeouts cost more to set up but they localise the failure and preserve the parts of the run that were fine.
4.4 Model routing reliability discipline that also controls cost
Not every agent needs the strongest model, and running one everywhere is the most common way teams triple their bill for marginal quality. The LLM Gateway routes per stage: Opus 4.8 for the Coder (where coding quality directly determines whether the review loop converges), Sonnet 5 for the Planner and Reviewer (strong enough to decompose a task and catch real bugs, roughly a fifth to a third of Opus's per-token cost), and Haiku 4.5 for the Researcher's cheap, high-volume sub-tasks like query formulation and relevance filtering. Routing is a reliability decision as much as a cost one: keeping the Coder on the best model is what makes the bounded loop terminate in two rounds instead of hitting the cap.
The alternative close call was Opus 4.8 for all four agents. Simplest to reason about, and correct as a Phase 1 default (optimise accuracy first). But at steady state it's roughly a 5× premium on the Planner and Reviewer stages for quality gains that don't move the review-convergence needle so once evals prove Sonnet holds review quality, routing is the obvious win. We deliberately start all-Opus and route later, rather than prematurely optimising before we can measure the quality hit.
5. Well-Architected Review
Operational Excellence
Everything ships through IaC and CI/CD: Terraform for the AWS surface (Fargate services, RDS, VPC, IAM) and the Temporal Cloud namespace, with workflow/activity code deployed as versioned container images through a standard pipeline (build → test → replay tests against recorded histories → canary → promote). Replay testing is non-optional for durable workflows, it catches non-deterministic changes that would break in-flight executions before they reach production. Observability is OpenTelemetry end-to-end: a workflow-level span per run, child spans per activity, and grandchild spans per LLM call carrying model, token counts, latency, and retry/loop-iteration attributes, exported to Grafana Tempo (traces), Prometheus (metrics), and Loki (logs), all correlated by workflow-id. The Temporal Web UI gives a per-run event timeline essentially for free, half the observability story before you add a single custom metric. Runbooks cover the standard incidents (model-provider outage → circuit breaker + fallback model, poison task looping → cap + escalation, worker pool saturation → autoscale + bulkhead), and post-launch iteration runs on an eval harness that replays a golden set of tasks nightly and dashboards per-agent success rate, review-loop depth, and p95 latency.
Security
Authn/authz is tenant-scoped at the ingress (OIDC/JWT), and the workflow carries a tenant context that every activity honours, so one customer's task can never read another's artifacts or vector namespace. Data protection: TLS in transit everywhere, encryption at rest (S3 SSE-KMS for artifacts, RDS encryption for pgvector, Temporal Cloud encrypts event history), and secrets model API keys, DB creds in AWS Secrets Manager injected at runtime, never baked into images.
Network boundary: workers, RDS, and the gateway live in private subnets with no public ingress. Egress to the model provider and web-search API is through a NAT gateway with an allowlist. Least privilege: each agent's worker runs under its own IAM role scoped to exactly what it needs (the Researcher can read the vector store and call search, the Coder cannot), so a compromised Researcher can't write artifacts.
Compliance: No HIPAA/PCI/GDPR-hard regime, so no regime-specific controls are mandated but because customer code is sensitive IP, the tenant-isolation and encryption controls above are treated as load-bearing, and Temporal's event history is scrubbed of raw code payloads (artifacts by reference) to limit what sits in the orchestration store.
Reliability
The failure modes are named and handled: transient activity failure → bounded automatic retries with backoff agent timeout → per-activity StartToClose/ScheduleToClose limits with fallback (§4.3), model-provider degradation → gateway circuit breaker + fallback model. Coder/Reviewer non-convergence → hard loop cap + human escalation, worker crash mid-run → deterministic replay from event history resumes exactly where it stopped. That last property is the headline: because state lives in durable Event History rather than in a worker's memory, the system can resume mid-workflow across crashes and deploys. You never restart a half-finished task from scratch.
Redundancy: workers run across multiple AZs behind the task queues. Temporal Cloud is multi-AZ by default, with a 99.99% high-availability namespace available (at a 2× consumption multiplier) if the SLA warrants it at scale. Target SLOs: 99.5% of tasks reach a terminal state (approved or cleanly escalated — never silently dropped), p95 end-to-end latency under a stated budget (§Performance).
Performance Efficiency
The latency budget is dominated by model calls, not orchestration — Temporal adds low-single-digit-millisecond scheduling overhead per activity, negligible against multi-second LLM calls. So the wins are, run independent work concurrently (kick off the Researcher's sub-queries in parallel once the plan exists), cache aggressively (the plan, retrieved context, and prior code are re-sent every review iteration — prompt caching turns those into ~90%-cheaper, faster cached reads), and route models by difficulty so easy stages aren't paying the latency of the biggest model.
Scaling is horizontal and queue-driven: worker pools autoscale on task-queue backlog (schedule-to-start latency), and because workers are stateless, adding capacity is just adding containers with per-agent bulkheads, the slow expensive Coder scales independently of the cheap fast Researcher. Data-store sizing tracks the workload shape pgvector on a right-sized RDS instance for the Researcher's retrieval, and small workflow state (artifacts by reference) to keep event histories cheap to replay.
Cost Optimisation
The strategy, not just the numbers (see §6 for the table): the token bill is ~95% of spend, so optimisation is almost entirely about how many tokens hit which model.
The levers, in impact order: model routing (Opus only where it changes outcomes, a 5x to 25x spread between tiers), prompt caching across review iterations (the loop re-sends the same plan/context/code repeatedly the highest-leverage single change), capping and short-circuiting the review loop (each extra round is a full Opus+Sonnet exchange, a cheap Haiku "is this even close?" pre-check avoids burning Opus on hopeless attempts), and on infrastructure, Fargate Compute Savings Plans / Spot for the steady-state worker floor plus Temporal committed-use credits at scale.
What we deliberately over-provision early: In Phase 1 we run Opus everywhere and skip caching speed-to-trust over cost then invert in Phase 3 once evals confirm the cheaper routing holds quality.
Sustainability
The dominant footprint here is inference, not the servers, so the highest-leverage sustainability move is the same as the cost move. Don't run a large model where a small one suffices (routing) and don't recompute what you can cache (prompt caching cuts redundant inference across review iterations), plus capping the review loop to avoid wasteful re-generation. On infrastructure, workers are serverless/right-sized on Fargate (no idle always-on fleet capacity tracks queue depth), and batch/asynchronous execution is used wherever a task isn't interactively latency-bound. Region selection favours lower grid-carbon-intensity AWS regions where latency and data-residency allow.
Data lifecycle: Temporal Event History uses short retention (e.g., 7–30 days) with export to cheaper cold storage for anything needing longer audit, and S3 artifact lifecycle rules archive/expire old generations so storage (and its footprint) doesn't grow unbounded with task volume.
6. Cost Breakdown
Two scale points. Pilot ~ 500 tasks/day (15,000/month). Production ~ 10,000 tasks/day (300,000/month). One task = Planner + Researcher + Coder + ~2 review iterations. All figures are estimates at published July-2026 rates.
| Line item | Purpose | Pilot (~15K tasks/mo) | Production (~300K tasks/mo) |
|---|---|---|---|
| Claude API (LLM tokens) | All four agents' inference (Opus Coder, Sonnet Planner/Reviewer, Haiku Researcher) | ~$8,000–12,000 | ~$160,000–240,000 |
| Temporal Cloud | Durable orchestration Actions + storage (~40 Actions/task) | ~$100 (Essentials, within 1M bundle) | ~$1,000–1,300 (overage @ ~$50/M) |
| AWS Fargate (workers) | Stateless agent worker pool, autoscaled | ~$120 (incl. ALB/NAT overhead) | ~$700 (avg ~12 tasks + overhead) |
| RDS pgvector | Researcher vector store | ~$70 (db.t4g.medium) | ~$400 (db.r6g.large + storage) |
| Web Search API | Researcher external retrieval | ~$150 | ~$2,000 (provider-dependent) |
| Observability (Grafana Cloud) | Traces/metrics/logs backend | ~$50 | ~$500 |
| Est. monthly total | ~$8.5K–12.5K | ~$165K–245K |
The table's own message: infrastructure is noise, the model bill is the system. Temporal, Fargate, RDS, and observability together are ~$1–5K/month even at production scale the orchestrator that fixes all four reliability problems costs about as much as a single day's token spend. So cost-optimization is model-optimization:
Route models by stage. Opus 4.8 only for the Coder. Sonnet 5 for Planner/Reviewer. Haiku 4.5 for the Researcher's sub-tasks. On the ~5x–25x tier spread this is plausibly a 30–50% cut to the token line on its own.
Cache across the review loop. The plan, retrieved context, and prior code are re-sent every iteration, prompt caching makes those cached reads ~90% cheaper. Given the loop, this is the single biggest lever.
Short-circuit hopeless attempts. A cheap Haiku pre-check ("is this remotely close?") before a full Opus revision keeps the expensive model off attempts that won't converge, and the hard loop cap bounds worst-case spend per task.
Commit the steady-state floor. Fargate Compute Savings Plans (or EC2 launch type) for baseline worker capacity with Fargate Spot for burst, and Temporal committed-use credits once Action volume is predictable, trim the (already small) infra line 30–50%.
7. Trade-offs & Alternatives Considered
| Option considered | Why rejected / when it would be the right call |
|---|---|
| Build a bespoke orchestrator (custom queue + state table + retry logic) | Rejected: you'd be re-implementing durable execution retries, timeouts, replay, visibility and doing it worse. Right call only if you have a platform team that wants to own this and hard constraints rule out every managed option. |
| AWS Step Functions (managed state machine) | Rejected for this workload: the ASL/JSON DSL is awkward for dynamic, code-driven loops like the review cycle, and the 25K-event history ceiling and per-transition model chafe against long, retry-heavy agent runs. Right call if you're fully AWS-committed, want zero infra, and your workflows are short and mostly static. |
| LangGraph (agent-native graph framework) | Rejected as the durability layer: excellent DX for expressing the agent graph, but you still want an industrial durable backend for crash recovery, timeouts, and ops at scale. Right call for fast prototyping, or paired with Temporal (LangGraph for graph logic, Temporal for durable execution) if the team already lives in it. |
| Message-bus choreography (SQS/EventBridge/Kafka) | Rejected: pushes ordering into emergent distributed behaviour the exact source of the Researcher/Planner race with no single place to read run logic. Right call when the agent graph is large and independent teams must deploy their agents autonomously. |
| Airflow / Prefect / Dagster | Rejected: built for scheduled batch/data pipelines, wrong latency profile for interactive, request-scoped agent runs with tight feedback loops. Right call if agent tasks were nightly batch jobs rather than interactive. |
| Opus 4.8 for all four agents | Rejected at steady state (correct as a Phase-1 default): ~5x premium on Planner/Reviewer for quality that doesn't move review convergence. Right call before you can measure the quality hit of cheaper routing optimise accuracy first. |
| Self-hosted open model (Llama/DeepSeek on GPUs) | Rejected for pilot: GPU ops burden and utilization risk outweigh token savings until volume is very high and steady. Right call at large, predictable scale where a saturated GPU fleet beats per-token API pricing, and for data that can't leave your boundary. |
8. Rollout & Iteration Strategy
Ship the reliability before the economy.
Phase 1 is the smallest thing that stops the bleeding: the durable workflow with the explicit DAG (kills the race), per-activity timeouts and bulkheads (kills the hang), and the bounded review loop with escalation (stops silent bug-shipping). Run Opus everywhere and don't touch caching — the goal is to prove the pipeline is correct and recoverable, and cost is a Phase-3 problem. Ship it behind a flag to a small slice of traffic, and compare task success and escaped-bug rate against the old chain.
Phase 2 is instrumentation and evaluation. Wire OpenTelemetry through the whole run, stand up per-agent dashboards (success rate, review-loop depth, p95 latency, tokens/task), and build a golden-set eval harness that replays representative tasks nightly. Now you have the measurement apparatus you need to change models safely you can quantify "does Sonnet hold review quality" instead of guessing.
Phase 3 inverts the priority to cost, using the trust you earned. With evals as a guardrail, roll out model routing one stage at a time (Reviewer → Sonnet first, measure, then Planner leave the Coder on Opus), turn on prompt caching across the review loop, add the Haiku pre-check short-circuit, and commit the worker floor to Savings Plans. Each change is gated on the eval harness not regressing. The feedback loop that ties it together: every escalation to the human queue is a labelled example of where the system couldn't converge those feed back into prompt/model tuning and the golden set, so the review-loop cap gets hit less often over time. The honest version of the plan is: optimise for accuracy first, cost second then invert once the system has earned trust.
9. Key Takeaways
Multi-agent reliability is an orchestration problem, not a prompting problem. When a pipeline of agents falls over, reach for durable execution before you reach for a bigger model most "the agents are flaky" symptoms are really "nothing owns the run."
Make ordering a data dependency, not a timing coincidence. If step C needs the outputs of A and B, gate C on those outputs existing. Parallelising for latency is fine, letting the wall clock decide correctness is not.
Any agent that judges needs a bounded loop back to the agent that acts. A reviewer with no return path is decoration. Cap the loop, and make the terminal state a loud escalation never a silent pass-through.
Isolate failure at the step, not the pipeline. Per-activity timeouts, heartbeats, and bulkheads turn "one slow agent hangs everything for 30 seconds" into "one agent times out and the orchestrator decides what to do."
You can't fix what you can't see, and durable orchestration gives you half the observability for free. The event history is a per-run timeline, add OpenTelemetry spans over it and "which agent failed and why" becomes a dashboard query instead of an archaeology dig.
Comments
Join the discussionNo comments yet. Be the first to comment.