AI ENGINEERING | LIVING GLOSSARY | #016
AGENT ORCHESTRATION
Coordinating Agent Execution and Handoffs
Chapter 3: Connecting AI to Tools, Workflows, and Agents
Lesson 16 of 24
AIYING — Accomplishing with AI
At 10:15 AM, a software company's payment service begins failing.
Customers cannot complete transactions. The incident response team needs answers quickly.
Imagine an AI-enabled engineering system with three specialized agents:
- A diagnostic agent that examines metrics and logs.
- A code-analysis agent that inspects recent changes.
- A verification agent that checks proposed fixes against available evidence and tests.
Each agent can contribute useful work. But who decides which agent acts first? What information should be passed between them? What happens if their conclusions conflict? Who authorizes a production change?
Simply connecting multiple agents does not answer these questions.
The system needs agent orchestration.
1. What Is Agent Orchestration?
Agent orchestration is the coordination of one or more AI agents, tools, workflow operations, and human participants to accomplish a larger goal under defined execution and control rules.
It may manage:
- Task assignment and delegation.
- Execution order and dependencies.
- Parallel and sequential operations.
- Agent-to-agent handoffs.
- Shared task state and context.
- Validation of intermediate results.
- Permissions and human approvals.
- Retries, timeouts, and recovery.
- Completion and outcome verification.
Orchestration does not necessarily require multiple agents. A single agent may be orchestrated alongside deterministic software and tools.
Likewise, a multi-agent system does not automatically need a separate AI-powered supervisor. Coordination can be implemented through conventional software.
Key distinction: Agents contribute decisions or specialized work. Orchestration determines how that work fits into the larger process.
↑ Back to contents2. Why Agent Orchestration Matters
A collection of capable agents can still produce an unreliable system.
Consider these possible failures:
- Two agents independently modify the same resource.
- An analysis agent uses outdated information.
- A verification agent receives an incomplete handoff.
- One agent reports success while another reports failure.
- An agent repeats a costly operation unnecessarily.
- A production deployment begins without approval.
- The overall process stops without recording its final state.
Orchestration addresses coordination problems that individual agent intelligence cannot reliably solve on its own.
| Without explicit coordination | With engineered orchestration |
|---|---|
| Responsibilities may overlap. | Task ownership is defined. |
| Handoffs may be informal. | Handoffs use structured contracts. |
| Agents may use inconsistent context. | Relevant state is managed and versioned. |
| Execution may be difficult to trace. | Steps and dependencies are recorded. |
| Failures may leave uncertain outcomes. | Recovery and escalation paths are specified. |
| Local agent success may be mistaken for task completion. | The overall business outcome is verified. |
Orchestration makes coordination explicit. It does not eliminate the need to evaluate the underlying agents.
↑ Back to contents3. Common Agent Orchestration Patterns
A. Sequential handoff
One agent completes a defined task and passes its result to the next.
Diagnostic Agent
|
v
Code Analysis Agent
|
v
Verification Agent
|
v
Human Review
Useful when later work depends on earlier findings.
B. Supervisor or coordinator pattern
A coordinator selects which specialized agent should perform the next task.
Coordinator
/ | \
v v v
Agent A Agent B Agent C
\ | /
v v v
Integration
The coordinator may use deterministic rules, a model, or both.
C. Parallel specialization
Independent agents work concurrently on separate subtasks.
For example, one agent investigates logs while another examines recent code changes.
Their results must be synchronized before a dependent decision proceeds.
D. Planner-executor pattern
A planning component proposes tasks; execution components carry them out under application control.
Plans must remain revisable when observations contradict assumptions.
E. Review-and-revise pattern
One agent generates a candidate result and another evaluates it against defined criteria.
The review process requires stopping limits. Repeated agreement between models is not independent proof of correctness.
F. Human-gated orchestration
Automated investigation proceeds until an operation requires authorized human approval.
Approval must be enforced by the application, not inferred from conversational text.
4. How Agent Orchestration Works
A representative orchestration process is:
Business Goal
|
v
Validate Request
|
v
Create Task State
|
v
Select Coordination Plan
|
v
Assign Agent Responsibilities
|
v
Execute Permitted Tasks
|
v
Validate Intermediate Results
|
v
Handoff / Synchronization
|
v
Integrate Findings and Evidence
|
v
Approval if Required
|
v
Verify Final Outcome
|
v
Complete or Escalate
Some stages may repeat, branch, or execute in parallel.
The orchestrator should track what has completed, what is pending, which outputs are authoritative, and which operations remain blocked.
The model may recommend a next step, but trusted application controls must decide whether it is permitted to execute.
↑ Back to contents5. Orchestration vs Workflows and Agents
| Concept | Main role | Illustration |
|---|---|---|
| Tool Calling | Requests an external capability. | Read incident logs. |
| Workflow | Defines and executes a coordinated process. | Incident intake, triage, review, closure. |
| AI Agent | Selects actions toward a goal using model-guided decisions. | Investigates an unfamiliar error. |
| Agent Orchestration | Coordinates agent tasks, dependencies, handoffs, and execution controls. | Assigns investigation and verification to specialized agents. |
These concepts overlap.
An agent can operate within a workflow. A workflow engine can orchestrate multiple agents. A single agent can coordinate tool use internally.
The terms describe different engineering responsibilities, not necessarily separate products or software layers.
↑ Back to contents6. Engineering Architecture
A production-oriented agent orchestration architecture may include:
1. Task intake
Receives the goal, relevant inputs, identity, and execution constraints.
2. Orchestration controller
Schedules tasks, tracks dependencies, manages state transitions, and coordinates handoffs.
3. Agent registry
Defines agent capabilities, responsibilities, and allowed operations.
4. Agent execution environments
Run model-driven tasks with appropriate tool access and resource limits.
5. Tool gateway
Validates and authorizes access to APIs, data stores, and other capabilities.
6. Shared task state
Stores structured progress, artifacts, and relevant evidence.
7. Validation and integration layer
Checks agent outputs, resolves dependencies, and assembles results.
8. Policy and approval layer
Enforces business restrictions and required human decisions.
9. Observability layer
Tracks execution, latency, tool usage, failures, and costs.
10. Outcome verification
Confirms that the intended task was completed using appropriate evidence.
User / Business Goal
|
v
Orchestration Layer
|
+-----------+-----------+
| | |
v v v
Agent A Agent B Agent C
| | |
+-----------+-----------+
|
v
Validated Handoff Results
|
v
Integration and Review
|
v
Approval Gate
|
v
Verified Final Outcome
Across all stages:
State | Permissions | Monitoring | Recovery
Not every application requires all these components as separate services. Smaller systems can implement several responsibilities in one application.
↑ Back to contents7. Handoffs and Shared State
A handoff transfers responsibility for a task or subtask from one component to another.
Reliable handoffs require more than forwarding a conversational transcript.
What should a handoff contain?
- Task and correlation identifiers.
- Sending and receiving component roles.
- Clear objective and expected output.
- Relevant validated inputs.
- References to supporting evidence.
- Current status and known uncertainties.
- Permissions and execution constraints.
- Output schema and completion criteria.
Illustrative handoff contract
{
"task_id": "INC-204",
"from": "diagnostic_agent",
"to": "code_analysis_agent",
"objective": "Inspect recent changes",
"service": "payment-api",
"evidence_refs": [
"log-set-17",
"metric-set-08"
],
"suspected_area": "timeout handling",
"confidence": "tentative",
"allowed_actions": [
"read_repository",
"inspect_commits"
],
"prohibited_actions": [
"merge_code",
"deploy"
],
"expected_output": {
"findings": "array",
"evidence_refs": "array",
"uncertainties": "array"
}
}
This is an illustrative application-level contract, not a universal agent communication standard.
Shared state is not unrestricted shared memory
Different agents may need different subsets of information.
Use access controls, versioned artifacts, and clear ownership to prevent accidental exposure, conflicting updates, or stale decisions.
Handoff validation
The receiving component should validate the handoff structure and independently enforce its own permissions.
Claims generated by one agent should not automatically become trusted facts for another.
8. Security, Reliability, and Recovery
Least privilege
Each agent receives only the tools and permissions needed for its responsibility.
Independent authorization
The orchestrator and tool gateway enforce access controls outside model-generated instructions.
Untrusted inputs
Logs, documents, repository files, and agent outputs may contain misleading content or prompt-injection attempts.
Structured validation
Check handoff schemas, required fields, artifact references, and permitted transitions.
Timeouts and budgets
Limit execution duration, tool calls, retries, and total resource consumption.
Concurrency control
Prevent agents from making conflicting updates to shared resources.
Idempotency
Protect state-changing operations against duplicate execution after retries or restarts.
Checkpointing
Persist sufficient state to resume or safely terminate interrupted tasks.
Human intervention
Route high-risk, uncertain, or conflicting outcomes to authorized reviewers.
Outcome verification
Use independent system evidence to verify consequential operations.
Traceability
Record which component performed each operation, which evidence it used, and what actually happened.
Important: If a deployment request times out, the orchestrator should check the deployment system's authoritative status before attempting another deployment.
↑ Back to contents9. Industry Applications
| Domain | Potential orchestration pattern |
|---|---|
| Software engineering | Diagnosis, code analysis, testing, human review. |
| Customer support | Issue classification, specialist investigation, escalation. |
| Business research | Source gathering, evidence analysis, synthesis, verification. |
| Supply chain | Exception detection, inventory analysis, replenishment recommendation. |
| Financial operations | Document review, reconciliation, exception handling, approval. |
| Enterprise knowledge | Retrieval, comparison, summarization, factual review. |
| Security operations | Alert triage, evidence collection, analysis, authorized response. |
| Content production | Research, drafting, editorial checking, publication approval. |
Specialized agents may improve modularity, but the benefit should be measured against the additional cost, latency, and coordination complexity.
↑ Back to contents10. Engineering Design Decisions
- Does this task require more than one agent?
- Could a single agent or deterministic workflow be simpler?
- Which responsibilities should be specialized?
- Which tasks depend on other tasks?
- Which tasks can run in parallel?
- Who decides the next agent to execute?
- What information must each handoff include?
- Where will authoritative state be stored?
- How will conflicting findings be resolved?
- Which tools may each agent access?
- Which actions require human approval?
- How will execution limits be enforced?
- How will interrupted tasks recover?
- How will intermediate results be evaluated?
- How will the final outcome be independently verified?
- How will the multi-agent design be compared with a simpler baseline?
Engineering decision: Use specialization only where it produces demonstrable improvements in quality, maintainability, or task success.
↑ Back to contents11. Practical Industry Case: Coordinating a Production Incident
Scenario: A fictional software company experiences increased payment failures after a recent release.
An AI-assisted incident response system is allowed to investigate using read-only tools. Production changes require human authorization through the organization's deployment process.
Agent responsibilities
| Component | Responsibility | Permission boundary |
|---|---|---|
| Orchestrator | Assign tasks, manage dependencies and state. | Cannot bypass approvals. |
| Diagnostic agent | Inspect metrics, errors, and incident timelines. | Read-only telemetry. |
| Code-analysis agent | Inspect relevant commits and code paths. | Read-only repository access. |
| Verification agent | Assess evidence and run permitted tests. | Isolated test environment. |
| Human incident lead | Authorize consequential remediation. | Established organizational authority. |
Step-by-step execution
- Trigger: Monitoring reports an abnormal payment failure rate.
- Intake: The orchestrator creates incident task INC-204.
- Assignment: The diagnostic agent receives a bounded investigation request.
- Observation: Metrics show increased timeouts after a release.
- Handoff: The diagnostic agent passes evidence references and uncertainty to code analysis.
- Analysis: The code-analysis agent identifies a potentially relevant timeout configuration change.
- Verification: The verification agent evaluates the proposed explanation using approved tests and available evidence.
- Integration: The orchestrator assembles findings, conflicts, and unresolved questions.
- Review: The human incident lead examines the evidence and decides whether to approve remediation.
- Execution: If authorized, the organization's controlled deployment workflow performs the change.
- Verification: Operational monitoring checks whether the failure rate returns to an acceptable level.
- Closure: The incident is closed only after the required verification and record updates.
Failure scenario A: Conflicting conclusions
The diagnostic agent suspects a network problem, while the code-analysis agent suspects a configuration change.
The orchestrator records both hypotheses and requests additional evidence rather than treating either claim as established fact.
Failure scenario B: Missing handoff evidence
The code-analysis agent receives a conclusion without supporting logs or metrics.
The handoff fails validation, and the orchestrator requests the missing evidence.
Failure scenario C: Verification agent timeout
The orchestrator records the incomplete verification and follows a bounded retry or human escalation policy.
Failure scenario D: Unauthorized deployment request
An agent proposes deploying a fix directly.
The application blocks the operation because production deployment requires authorization through a separate controlled process.
What this case demonstrates
Individual agents can investigate different aspects of a problem. The orchestrator is responsible for ensuring that their work is coordinated, evidence is preserved, and operational boundaries remain intact.
12. Hands-On Mini Project
Design a Simulated Multi-Agent Incident Response System
Objective: Build or document an orchestration system that coordinates specialized agents using fictional incident data.
No real production infrastructure or deployment permissions are required.
Step 1: Define the goal
Investigate a fictional payment service incident and produce an evidence-supported recommendation or escalation.
Step 2: Define three roles
- Diagnostic agent.
- Code-analysis agent.
- Verification agent.
Step 3: Create fictional evidence
Prepare incident logs, performance metrics, and a small list of recent code changes.
Step 4: Define handoff schemas
Include task ID, objective, evidence references, uncertainties, permitted actions, and expected outputs.
Step 5: Implement orchestration
Coordinate diagnostic investigation, code analysis, verification, and final integration.
Step 6: Add policy boundaries
Permit read-only investigation and simulated testing. Prohibit actual production changes.
Step 7: Introduce failures
- Missing evidence in a handoff.
- Conflicting agent findings.
- Tool timeout.
- Duplicate task assignment.
- Unauthorized deployment request.
Step 8: Evaluate
| Metric | Evaluation question |
|---|---|
| Task completion rate | Did the system reach an appropriate verified outcome or escalation? |
| Handoff validity | Were required fields and evidence references present? |
| Coordination accuracy | Were tasks assigned to appropriate components? |
| Authorization violations | Did any prohibited operation execute? |
| Conflict handling | Were contradictory findings handled explicitly? |
| Recovery success | Could the system resolve or safely escalate failures? |
| Execution efficiency | How many model and tool calls were required? |
| End-to-end latency | How long did the complete process take? |
| Evidence fidelity | Were final conclusions supported by the available evidence? |
Step 9: Compare with a simpler baseline
Design a single-agent or deterministic workflow for the same task.
Compare task success, cost, latency, failure handling, and implementation complexity.
Success criteria
- Every agent has a defined responsibility.
- Handoffs are validated.
- Conflicting findings are not silently discarded.
- No unauthorized operation executes.
- All test runs terminate within defined limits.
- The final report preserves evidence and uncertainty.
- The design can be justified against a simpler alternative.
Reflection
Did specialization improve the result? Which coordination costs were introduced? When would a single-agent design be preferable?
13. Connected Glossary Terms
- Tool Calling (#013): Provides external capabilities to agents.
- Workflows (#014): Define structured execution and process transitions.
- AI Agents (#015): Perform model-guided tasks toward defined goals.
- Prompt Engineering (#006): Helps specify agent responsibilities and instructions.
- RAG (#004): Supplies relevant retrieved evidence.
- Context Window (#005): Limits how much information can be passed to an agent in one model interaction.
- Evals (#007): Tests component behavior and system-level outcomes.
- Hallucination (#008): Can propagate unsupported claims through handoffs.
- Grounding (#009): Connects findings to supporting evidence.
- Guardrails (#010): Enforces permissions and execution restrictions.
- Observability (#011): Makes multi-step execution traceable.
- Human-in-the-Loop (#012): Provides approval and escalation mechanisms.
Previous lesson: #015 — AI Agents: Goal-Directed Systems That Use Tools and Make Decisions
Next lesson: #017 — Model Context Protocol (MCP): Standardizing Connections Between AI Applications and Tools.
↑ Back to contents14. Living Update
Editorial baseline: November 2026
Agent orchestration continues to evolve through agent frameworks, durable execution systems, tool integration standards, and enterprise governance practices.
Areas to monitor include:
- Structured agent-to-agent communication.
- Agent interoperability protocols.
- Model Context Protocol integration.
- Durable orchestration and recovery.
- Distributed tracing across agent boundaries.
- Agent identity and delegated authorization.
- Human approval and intervention patterns.
- Multi-agent evaluation benchmarks.
- Coordination cost and latency optimization.
- Security risks arising from cross-agent instructions.
Living Glossary note: Revisit this entry as agent communication standards, orchestration frameworks, and evaluation practices mature.
↑ Back to contents15. Key Takeaway
The aim is not to build the largest possible team of AI agents.
The aim is to design the simplest coordinated system that accomplishes the task reliably.
Think like an AI engineer: If three agents produce three different answers, what mechanism determines the next action—and what evidence is needed before the system can claim success?
↑ Back to contents16. References and Further Reading
- LangGraph — Orchestration and Agent Workflows
- Temporal — Durable Execution
- OpenAI — Agents Documentation
- Model Context Protocol — Documentation
- OpenTelemetry — Distributed Tracing
- OWASP — Generative AI Security Project
- NIST — AI Risk Management Framework


No comments:
Post a Comment