How to build an agent orchestration pipeline: stages, architectures, and what breaks
A production agent orchestration pipeline has eight stages: trigger, plan, route, isolated execution, approval gates, deliverables, memory and resume. How each works, which multi-agent architecture to pick, what breaks in practice, and how Kavela runs it.
An agent orchestration pipeline is the system that turns a request into finished work using several AI agents. A trigger starts it, a planner splits the work into tasks, a router hands each task to a worker, workers run in isolated environments, humans approve risky steps, and results land as deliverables, with memory and resume keeping it reliable.
What are the stages of an agent orchestration pipeline?
There are eight, whether you design them on purpose or discover them one incident at a time:
- Trigger. Something starts the work: you, a schedule, or an event like a webhook.
- Plan. A planner agent turns the request into tasks, each with an owner, inputs and a definition of done.
- Route. Each task goes to the worker with the right skills and access.
- Execute. Workers run in isolated environments with their own files, shell and browser.
- Gate. Steps that can't be undone (publishing, deploying, spending, signing in) wait for a human.
- Deliver. Output lands as files, links and reports attached to the task.
- Remember. Preferences and decisions persist beyond a single run.
- Recover. Interrupted runs resume from where they stopped.
A single agent in a chat window covers stages 2 and 4, and only while you watch. You need the rest once work repeats, runs while you're away, or spans more than one agent. Stages 1 to 4 get built first because they're the visible part; stages 5 to 8 are where pipelines fail in production.
How should an agent pipeline start and plan work?
Start with triggers, because they decide whether the pipeline runs without you. Support three kinds:
- On demand: you ask, and it starts now.
- Scheduled: a routine like "every Monday at 8:00", set in your own time zone and optionally limited to a date range.
- Event-driven: a webhook from Stripe or GitHub, a new file in a folder, an email arriving.
Planning is where most pipelines are weakest. The planner should write tasks as records (title, owner, inputs, acceptance criteria, due date) that can be scheduled, assigned, retried and audited later. A plan that only exists as prose in a chat log can't be any of those things.
Keep the planner separate from the workers. A planner that also executes ends up grading its own homework, and it loses the thread once its context fills with tool output from the jobs it was supposed to oversee.
A quick test for any plan: could a person read the task list and say who is doing what, by when, and what done looks like? If they couldn't, your workers can't either.
How do you route tasks to worker agents and isolate them?
Route on capability. Each worker should own a narrow job (shipping code, writing posts, research) and carry the skills, tools and credentials for that job only. The planner then matches each task to a worker's description. One generalist agent with every tool attached picks the wrong tool more often, and when it does, you can't tell which part of its giant prompt caused it.
Isolation is the part people skip, and it's the part that bites. Give every worker its own environment:
- Its own filesystem, so two agents never edit the same checkout at once.
- Its own shell and browser, so a long install or a stuck page in one run can't stall another.
- Scoped credentials, so the agent that writes posts never holds your production database key.
Put those environments in the cloud as well. A worker on your laptop stops when the lid closes, and real pipelines have runs that last hours. A container per worker is the usual answer: cheap to start, disposable, and easy to inspect after something goes wrong.
Where do human approval gates belong in an agent pipeline?
Put gates on actions that are public, irreversible or cost money. Sort everything a worker can do into two buckets:
- Runs freely: reading, drafting, researching, writing files, running tests, opening a preview.
- Waits for you: publishing a post, deploying to production, emailing a customer, paying for something, signing in to an account, connecting an app.
Then make the gate behave well. A good gate parks the run with its state saved, shows you the exact payload (the real post text, the real diff), and resumes the moment you answer. A bad gate holds a thread open, times out after ten minutes, or quietly approves itself.
Collect every pending approval from every agent in one inbox. When approvals are scattered across terminal prompts and chat tabs, you miss them and runs sit idle for hours. Worse, you start granting broad permissions just to make the interruptions stop, and approval fatigue switches your gates off without anyone deciding to.
How do deliverables, memory and resume keep a pipeline reliable?
Deliverables, memory and resume decide whether you can trust what a pipeline produced, and whether it survives a bad day.
Deliverables. Every task should end with something you can open: files, a preview link, a report, a branch. Attach them to the task that produced them. If finished work only exists somewhere in a transcript, you'll end up re-running the task to find it.
Memory. Store preferences and decisions outside any single context window: your tone, which repo is canonical, the vendor you already ruled out. Workers read memory at the start of a run and update it when you correct them.
Resume. Runs get interrupted by crashes, deploys, rate limits and usage caps. Save state at each step so a run picks up where it stopped. Make side effects idempotent: before retrying, check whether the post already exists or the charge already went through, or the retry becomes a duplicate. And treat a usage limit as a pause with a choice for you, since failing the run throws away the work it already did.
Which multi-agent pipeline architecture should you use?
Three patterns cover most real pipelines:
| Architecture | How it works | Fits | Breaks when |
|---|---|---|---|
| Sequential | Agent A's output feeds B, then C | Fixed flows like research, draft, edit | One stage fails and everything after it stalls or runs on bad input |
| Manager/worker | A planner splits work, assigns workers, checks results | Open-ended requests needing mixed skills | The manager's context fills up, or it routes everything to one worker |
| Event-driven | Agents react to webhooks, files and schedules | Ongoing operations that run without you | Nobody can see what fired what, or what is still running |
For a solo builder, start with manager/worker and feed it from schedules and events. You get one planner that understands your goals, specialist workers that stay good at one thing, and triggers that keep the whole thing running while you sleep. Any fixed sequence you discover along the way can live inside a single worker's task. For more on the manager side, see how Claude can manage other agents.
What breaks when you run an agent pipeline in production?
The failures that cost the most time are almost all plumbing:
- Silent stalls. A run waits on a prompt nobody sees. You need one place that lists everything waiting on you.
- Clobbered files. Two workers in one directory overwrite each other's changes.
- Credential sprawl. The same API key pasted into five agent configs, each expiring on a different day. Connect each service once, centrally.
- Planner overload. The manager's context fills with worker logs until it forgets the goal. Workers should hand back summaries and deliverables, and keep raw logs to themselves.
- Duplicate side effects. A retry sends the customer email twice.
- Limits mid-run. A subscription or rate limit hits halfway through a long job, and the run dies with nothing saved.
- No visibility. Nobody can answer "what ran yesterday, and what did it produce?" without digging through logs.
Stalls, sprawl and visibility all come down to where you watch and steer the work from, so the tool you orchestrate in matters. We compare the options in choosing an IDE for agent orchestration.
How does Kavela implement an agent orchestration pipeline?
Kavela is a cloud workspace for AI agents. You talk to one agent, Kav, and the workspace covers every stage:
- Trigger: tasks that start right away, routines on a schedule, and events such as a webhook or a new file in the workspace.
- Plan: Kav plans the work and files it as tasks on a calendar, with scheduled starts, due dates and multi-day bands.
- Route: Kav hands each part to the right worker, like Ship for production apps or Echo for social posts.
- Execute: every worker has its own cloud computer with a shell, files, git and a browser, so runs continue after you close your laptop. Workers can run Claude Code or Codex on your own plan.
- Gate: anything that needs you waits in one Approvals inbox, also on Telegram.
- Deliver: deliverables attach to the task and to the workspace's Delivered list.
- Remember: agents carry skills and memory of your preferences.
- Recover: runs park and resume. Kavela rotates across your connected Claude or Codex accounts as each hits its usage limit; when all are limited, the run asks once: wait and resume, finish on Kavela credits, or cancel.
Kavela is in early access and runs on your own Claude or Codex subscription, with a 14-day free trial. Start your free trial