danielhuber.dev@proton.me Saturday, April 4, 2026

Sequenced Pipelines: How Structured Handoffs Improve Multi-Agent Systems

How sequenced specialist agents with defined handoff contracts and backward feedback loops produce more reliable results than flat swarms or orchestrator/worker splits.


April 2, 2026

An open-source project called gstack defines over thirty specialized agent roles — product diagnostician, architecture reviewer, security auditor, QA tester, release engineer — and wires them into a sequenced pipeline where each role’s output becomes the next role’s input. It’s being used to ship production software, and its architecture illustrates a pattern worth examining.

Most practitioners building production multi-agent systems have moved past monolithic single-agent prompts. The more interesting question is how to organize the specialization. Two common approaches — flat swarms that parallelize without coordination, and orchestrator/worker splits that funnel everything through a planning agent — each fail in instructive ways. The alternative is a sequenced pipeline with structured handoffs, and the pattern has more in common with manufacturing assembly lines than it does with typical AI architecture.

The Real Opponent Isn’t the Monolithic Prompt

The obvious argument against single-agent-does-everything is already won. Most practitioners building production systems use some form of multi-agent setup. The real question is how you organize the specialization — and the two most common approaches each fail in instructive ways.

Flat swarms run multiple agents in parallel on different aspects of the same task. The appeal is speed: why sequence work when agents can run simultaneously? The problem is coordination. The frontend agent and the API agent make incompatible interface assumptions. The security agent reviews code that the refactoring agent is about to change. A test agent validates behavior against a schema the data modeling agent just restructured. Parallel execution is fast, but it produces the same integration conflicts that human teams created before they adopted pull request workflows and branch-based development.

Note

The problem with flat swarms isn’t parallelism — it’s that agents working simultaneously on shared state produce the same integration conflicts that human teams created before they adopted pull request workflows. The organizational solution was sequencing and review gates. The agent solution is the same.

Orchestrator/worker splits address coordination by funneling everything through a single planning agent that delegates to generic workers. The orchestrator holds all the context and makes all the decisions. The workers are interchangeable executors. This solves the coordination problem but creates a new one: the orchestrator becomes a bottleneck. It must understand security, architecture, testing, deployment, and product strategy well enough to write good prompts for each. The workers, meanwhile, have no domain-specific constraints, no specialized review criteria, and no memory of what went wrong last time. You’ve distributed the labor but not the expertise.

What both patterns miss is the same thing: structured handoffs. The output of one agent doesn’t flow as a defined artifact into the next. There’s no contract between stages. Knowledge is either duplicated across agents (wasting context window capacity) or lost between them (causing downstream errors that earlier agents already had the information to prevent).

The Pipeline Pattern

The alternative is a sequenced pipeline with defined stations. Each station has a specialist. Each specialist receives a structured input artifact from the previous station, does one thing well, and produces a structured output artifact for the next.

Sequenced Pipeline with Feedback Loop
┌───────────┐    ┌───────────┐    ┌───────────┐    ┌───────────┐    ┌───────────┐    ┌───────────┐    ┌───────────┐
│ DIAGNOSE  │───▶│   PLAN    │───▶│   BUILD   │───▶│  REVIEW   │───▶│   TEST    │───▶│   SHIP    │───▶│  REFLECT  │
│           │    │           │    │           │    │           │    │           │    │           │    │           │
│ Product   │    │ Architect │    │ Implement │    │ Security  │    │ QA agent  │    │ Release   │    │ Retro     │
│ questions │    │ decisions │    │ code      │    │ PR review │    │ real env  │    │ engineer  │    │ learnings │
└───────────┘    └───────────┘    └───────────┘    └───────────┘    └───────────┘    └───────────┘    └───────────┘
                                     ▲                                 │
                                     │          feedback               │
                                     └─────────────────────────────────┘

The pipeline is primarily forward-flowing, but feedback loops run backward. When the test station finds a bug, it doesn’t just log it — it routes a structured finding back to the build station, or to the plan station if the issue is architectural. When the review station flags a security concern, that finding feeds back into the build step with specific remediation requirements. The pipeline self-corrects.

Three properties make this pattern work:

Context isolation. Each station gets exactly the context it needs, nothing more. The security reviewer sees the code and the threat model, not the design mockups and product requirements. The QA agent sees the running application and the test plan, not the architectural rationale. This isn’t just an efficiency gain — it’s a quality gain. An agent with a full context window dedicated entirely to security catches things that a generalist splitting that same window across five concerns will miss. Attention is zero-sum, and the pipeline allocates it deliberately.

Handoff contracts. The output format of each station is a defined interface. The planning station produces architectural decisions in a parseable structure — not free-form prose that the next agent must interpret. The review station expects that structure as input and produces findings in a structure the build station can act on. This is the critical difference between a pipeline and “ask the agent to also review its own code.” Self-review has no interface boundary, no format constraint, and no forced perspective shift. A separate station with a defined input contract is structurally incapable of rubber-stamping.

Composability. Stations can invoke sub-pipelines. A planning station might trigger a product review, then a design review, then an engineering review — each a sub-specialist with its own input/output contract — before producing its final plan artifact. This is recursive decomposition, not flat delegation. The pipeline’s depth adapts to the complexity of the work.

What Makes a Good Station

The pipeline pattern describes the architecture. But the quality of each station determines whether the architecture actually delivers. Three properties separate effective pipeline stations from glorified prompt templates.

Scoped authority. A station knows what it’s responsible for and — critically — what it’s not. A review station checks for SQL injection, race conditions, and trust boundary violations, but it doesn’t refactor code style or suggest architectural changes. A planning station makes structural decisions but doesn’t write implementation code. Scoped authority prevents stations from stepping on each other’s output and keeps their artifacts predictable. When a station tries to do too much, its output becomes a grab-bag that the next station can’t parse reliably.

Real feedback loops. The best stations don’t just reason about artifacts — they interact with real environments. A QA station that opens an actual browser, clicks buttons, and reads console errors catches a fundamentally different class of bugs than one analyzing source code. A deployment station that verifies the production URL after shipping catches issues that a code-level check never will. This is the agent equivalent of giving an engineer access to staging instead of asking them to review code in their head. The pattern is simple: give specialists access to the consequences of their actions, not just the inputs.

Operational memory. A station that logs what it learned — “this codebase uses connection pooling pattern X,” “last time we touched this module, the auth tests broke,” “the user prefers atomic commits over large PRs” — starts the next pipeline run with better priors. This isn’t general-purpose retrieval-augmented generation. It’s scoped, operational knowledge that compounds. Session one is generic. Session twenty anticipates problems before they surface.

Station Qualities and Anti-Patterns
QualityWhat It MeansAnti-Pattern
Scoped authorityOne concern, clear boundaries”Review everything and also fix what you find”
Real feedbackInteract with running systems”Read the code and imagine what would happen”
Operational memoryLog learnings, feed forward”Start from scratch every session”
Defined outputStructured artifact for next station”Here’s what I think — good luck parsing it”

When This Pattern Breaks

The pipeline pattern has real costs, and pretending otherwise would make this analysis advocacy rather than architecture.

Overhead for small tasks. A seven-station pipeline for a one-line bug fix is absurd. Defining handoff contracts, maintaining specialist prompts, and wiring feedback loops has a setup cost. Below a certain complexity threshold, a single well-prompted agent is faster and cheaper. The threshold is lower than most people assume — most meaningful features benefit from at least a plan-build-review pipeline — but it exists, and ignoring it wastes tokens and time.

Handoff contract maintenance. The contracts between stations are effectively API interfaces — they need to be maintained as the codebase and the agents evolve. Stale contracts cause downstream stations to receive malformed input and produce garbage output. This is the same maintenance burden as API contracts between microservices, and it demands the same discipline. If you’ve ever debugged a broken integration because an upstream service changed its response format without updating the schema, you know exactly what a stale handoff contract feels like.

Diminishing returns on specialization. gstack defines over thirty specialists, which makes sense for a general-purpose framework designed to cover every scenario. Most teams need four to six well-defined stations, not thirty. Over-specialization fragments context unnecessarily and makes the pipeline harder to debug — you lose the ability to trace a problem to a single station when there are too many stations to reason about. More stations is not better stations.

Solo builder bias. The pattern has been demonstrated primarily by individual developers using AI to multiply their output. Whether it scales to teams — where multiple humans already provide role-based specialization — is genuinely open. It may be that the pipeline pattern is most valuable precisely when you don’t have a team, filling the roles that a solo builder can’t play simultaneously. In a team context, the overhead of maintaining agent specialists for roles that humans already fill might not pay off.

What This Means for Practitioners

If you’re building agent systems that do more than single-shot question answering, the pipeline pattern deserves serious consideration. Four recommendations:

Sequence your agents, don’t just parallelize them. Flat swarms produce integration conflicts for the same reason unsynchronized human teams do — parallel work on shared state without coordination gates. Pipelines with handoff contracts produce coherent output because each station builds on verified artifacts from the previous one. The sequencing isn’t a performance penalty; it’s the mechanism that makes the output trustworthy.

Design the handoff, not just the agent. The output format of each station is a contract with the next. If your planning agent produces unstructured prose, your review agent has nothing reliable to work with. Structured artifacts — parseable decisions, typed findings, actionable items with specific file references — are the connective tissue that makes the pipeline more than a sequence of independent agents. Invest more time in the interface between stations than in the prompts within them.

Give specialists real environments. A QA agent reading source code is doing code review, not quality assurance. A deployment agent that doesn’t verify the production URL isn’t deploying — it’s hoping. The value of specialization compounds when each specialist can observe the actual consequences of earlier stations’ work, not just read their output artifacts. Real environments close the gap between “this looks correct” and “this works correctly.”

Start with three stations, not thirty. Plan, build, review. That’s the minimum viable pipeline, and it already captures most of the value: forced perspective shifts, structured handoffs, and separation of concerns. Add a test station when you have a test infrastructure worth automating. Add a security station when your threat surface justifies it. Add a deployment station when your release process is complex enough to benefit. Each addition should be justified by a specific failure mode that existing stations don’t catch.

The best agent architecture was never a better model. It was a better org chart.

Tags: perspectivesagent-architectureskillscoding-agentsmulti-agentharness