Routing Repetitive Engineering Tasks Through the Right Orchestration Primitive

A practical guide to matching task dependencies to the right agent pattern.

· 9 min read
Cover illustration for “Routing Repetitive Engineering Tasks Through the Right Orchestration Primitive”
Right-Sizing AI for Your Engineering Team · November 18, 2026 · 9 min read · 1,940 words

Choosing the right orchestration primitive for repetitive engineering tasks means matching how work depends on other work to how agents work together. For a small team with a limited budget, the starting point is a single agent, with added coordination only when the task requires it. Production reliability depends on that fit and on a runtime that preserves state, enforces permissions, and makes execution auditable.

Why repetitive engineering tasks break in production despite capable agents

An agent writes a fix, runs a test, reads the error, and tries again until it exhausts its token budget without converging. The individual steps may all look reasonable. The failure lies between them, where the system must preserve context, recognize progress, and control what happens next. Even a capable model cannot make up for missing execution structure just by taking another turn.

The write, test, read error, fix loop is now commodity. Production systems stand out through the structure they put around it. Graph Engineering in the Era of LLM Agents identifies organizational capacity as the underlying limit. Tasks that require different kinds of expertise, interdependent work, parallel execution, independent verification, and persistent state exceed what a single agent can organize.

That mismatch produces recognizable symptoms, including wrong tool selection, lost context, unrecoverable loops, and rising token spend where no isolation boundary exists. These are not all failures of reasoning. They can be failures to define who owns a subtask, what information belongs with it, or when execution must stop. Diagnosis therefore requires assessing both whether the agent can do the work and whether its coordination structure fits the work’s dependencies.

The five orchestration primitives and what each one actually controls

Fan-out controls the distribution of independent work. One orchestrator dispatches subtasks to workers, then collects and merges their results. The crucial condition is that workers share no intermediate state. Modern Agent Harness Blueprint describes this orchestrator-worker pattern as a default for context isolation and parallel work with manageable complexity. Its value comes from separating work that does not need continuous coordination.

Pipeline controls ordering. Each step produces the input required by the next, so failure at one node blocks the chain. Rinderle-Ma et al. describe orchestration options in which an explicit process specification frames agent invocation. The sequence is part of the task’s logic. A pipeline is useful because it preserves that dependency.

Debate controls the scrutiny applied to a single output. Agents with opposing mandates produce competing answers or critiques, and a judge or merge step resolves the disagreement. More workers do not necessarily mean more throughput here. The additional work exists to challenge a candidate before it is trusted. This gives independent verification an explicit place in the execution structure.

Supervisor controls delegation and intervention as work unfolds. It decomposes tasks, assigns workers, monitors progress, and can halt or redirect execution when evidence changes. Swarm instead distributes coordination across agents without a central controller or predefined workflow. Agents find subtasks, claim work, and use a protocol to hand it off.

These patterns answer different questions about control. Does coordination need to preserve independence, enforce order, challenge an answer, redirect work, or let assignments emerge? That distinction is more useful than comparing diagrams. It identifies the responsibility the orchestration layer must perform before a framework or implementation is chosen.

How task structure — not task size — determines which primitive fits

If subtasks can finish without one another’s intermediate output, fan-out is the default match. If each step needs the previous step’s verified output, a pipeline preserves the required order. Size does not settle that choice. A large set of independent tasks can still be simple to coordinate, while work with hard dependencies still depends on other work even when parallel execution is available.

Correctness introduces a separate branch in the decision. If a single output needs independent challenge, debate provides that check, either on its own or within another pattern. If the task graph is unknown at the start and work needs replanning or interruption, a supervisor fits. Swarm becomes relevant when the task space is too dynamic to plan centrally and latency demands extensive concurrency. Unknown work alone does not mean a swarm is needed.

A supervisor over independent work adds coordination overhead and a single point of failure. A pipeline without genuine ordering requirements serializes work unnecessarily. A swarm applied where auditability and human interruption are essential can sacrifice the very controls the task requires.

Rinderle-Ma et al. provide a broader test through autonomy, task specificity, reactivity, correctness assurance, traceability, and human involvement. These properties show what the work needs that a topology alone can hide. Can the task tolerate autonomous delegation, for example, if acceptance still belongs to a human reviewer? The answer may require a combined pattern rather than a choice of one primitive for the entire workflow.

Applying the matching framework to three recurring engineering tasks

Incident investigation has both an ordering dependency and a changing hypothesis. Evidence must be retrieved before it can be ranked, but ranking may reveal that the investigation needs different evidence. That structure points to a pipeline feeding a supervisor. Meta’s production pattern uses heuristic retrieval to narrow the candidate set before LLM-based ranking, with code ownership and runtime code graph traversal helping bound the search.

The supervisor can then redirect retrieval when confidence is low. A pure fan-out would retrieve everything and overwhelm the ranker, while a pure swarm would lose the auditability the on-call engineer needs. Retrieval quality, code-ownership context, runtime graphs, and confidence suppression all bound accuracy. The combined pattern must preserve these inputs.

PR review has a different dependency structure. Security, performance, and style review can each proceed on their own because none needs another specialist’s intermediate output. Fan-out follows directly from that independence. The A2A PR pipeline pattern delegates to these specialists in parallel through A2A, while each specialist uses its own MCP servers internally. The orchestrator does not need to know every tool each reviewer uses, and sequential review would add elapsed time without a correctness benefit.

Changes across a large repository can have a task graph that no single orchestrator can fully plan ahead of time. Work must then be claimed dynamically as agents encounter it. This is the structure illustrated by the Kimi swarm pattern. Its suitability remains conditional, however, on a well-bounded change surface and audit trails built into the runtime. Without those constraints, the gain in throughput trades away control and can create unrecoverable states.

What the runtime must provide regardless of which primitive you choose

Durable state, context isolation, policy enforcement, and audit are prerequisites across all five patterns. The harness blueprint recommends a durable state machine or graph runtime with checkpointing because long-running work needs pause, resume, replay, fault tolerance, and human interruption. For a supervisor to pause work, the runtime must be able to save that work.

The blueprint recommends starting with a single agent and adding subagents only for parallel exploration, specialized prompts or tooling, separate context windows, or explicit ownership boundaries. More agents are not the starting goal. An artifact-first filesystem keeps large tool outputs, plans, and handoffs outside the model context and refers to them through handles.

The model must also have no say in whether policy is enforced. Destructive tools, secret access, network egress, and external writes need deterministic checks, approval gates, sandbox restrictions, and audit trails in the harness. A prompt is not an enforcement boundary. Rinderle-Ma et al. distinguish process-aware orchestration from arrangements that leave correctness assurance and traceability hidden within the agent.

Protocol boundaries keep these responsibilities separate. MCP connects an agent to tools, while A2A handles remote agent-to-agent delegation between organizations or frameworks. The model vendor’s native SDK serves the inner inference loop, and ACP serves IDE and client surfaces in the blueprint’s recommended defaults.

For a small team, the assembly burden is significant. Retrofitting these guarantees onto general-purpose cloud tooling makes the team responsible for combining the pieces on each project. A purpose-built agent runtime absorbs that work by design. The relevant cost comparison is therefore not just model usage or framework access, but the engineering effort needed to make the selected primitive reliable.

Where the governance gap opens when primitive choice and runtime design are treated separately

Putting a human-in-the-loop can slow execution, and checking every handoff can reduce the throughput that parallel agents promise. But fan-out and swarm also multiply the number of agents acting with tool access, so their speed changes how agents must be authorized as well as how work must be scheduled.

Each parallel agent adds an authorization surface. Without a least-privilege policy for each agent, the blast radius of a compromised or poisoned agent can grow as fan-out grows. Messages and retrieved documents can become part of that exposure. The Singapore Consensus (2026) places least privilege, traceable identity, auditability, runtime assurance, interruptibility, and human oversight among its foundational principles. It also recognizes that responsibility spans developers, deployers, cloud platform providers, and open source ecosystems.

A supervisor helps only if it can actually interrupt. Monitoring execution without the authority to stop it does not preserve human control. Wang and Liu’s Software Engineering in the Agent Era distinguishes execution authority from acceptance authority. A Human–Agent Cell can produce candidates and evidence, but a human or institutional responsibility anchor must retain the boundary for accepting them. When the work spans several domains that each have their own governance, the supervisor must show the evidence to more than one reviewer.

Erroneous information in episodic memory can recur at later steps, even after the current answer has been corrected. A session-level correction does not remove a poisoned episode from long-term memory. Governance must therefore account for both what persists between actions and which tool call is allowed now. Primitive selection and runtime design belong in the same decision because each determines what the other must control.

A decision checklist for matching task structure to primitive before writing a line of code

Can subtasks proceed without one another’s intermediate output? If yes, fan-out is the default. Add a supervisor layer only when replanning or interruption is required. If no, map the dependencies before choosing. A linear graph points to a pipeline, while a dynamic graph points toward a supervisor or, where the other conditions permit it, a swarm.

Does correctness require independent challenge of a single output? If yes, include debate as a standalone primitive or a stage within a supervisor. If no, skip it. Structured disagreement adds to the cost of coordination when objective, testable outputs, such as code that compiles or tests that pass, already give the check that is needed.

Must a human or policy be able to interrupt execution? If yes, the runtime needs durable checkpointing and an approval gate. Swarm is disqualified unless the runtime supports per-agent interruption. If no, fan-out or swarm without a supervisor layer can be acceptable, provided the remaining task and governance conditions are met.

Are limits on each agent’s authorization surface set ahead of time? If the tools each agent will call are known, least-privilege policy can be defined per agent. If they are not, do not proceed directly to swarm. Use a supervisor with progressive subtask discovery so permissions expand only as the supervisor explicitly grants them.

Can the runtime enforce the resulting design? Work beyond a single inference turn needs a durable state machine with checkpointing. Working memory should be artifact-first, with tool outputs, plans, and handoffs referenced through handles. A runtime policy engine must gate destructive tools, secret access, and network egress through deterministic checks. An append-only event log must support auditability and replay. The checklist is only as useful as the runtime that enforces it.

Sources

  1. Design and Implementation of Agentic Orchestrations and Orchestration of Agents
  2. Graph Engineering in the Era of LLM Agents: From Individual Intelligence to System Intelligence
  3. Software Engineering in the Agent Era From Trustworthy Change to Human Agent Software Organizations
  4. From Question Answering to Task Completion: A Survey on Agent System and Harness Design
  5. Deontic Policies for Runtime Governance of Agentic AI Systems

More in Right-Sizing AI for Your Engineering Team