Skip to main content

What is an Orchestration?

An Orchestration is a container that groups multiple agents (entities) and runs them using a coordination strategy. Each entity agent has its own system prompt, tools, and knowledge bases, and the orchestration handles how they interact. You choose a strategy that matches your use case: Supervisor for autonomous delegation, Sequential for pipeline processing, or Parallel for concurrent execution with merged results.

Execution Strategies

Supervisor Strategy

The Supervisor strategy creates a coordinator agent that has access to a delegation tool for each entity agent. When a user message arrives, the coordinator reasons about which entity should handle it and calls the appropriate delegate_to_ tool with a task description. The entity agent runs with its own tools and knowledge bases (up to 10 ReAct steps by default) and returns its result. The coordinator can delegate to several entities in sequence, or feed the result of one delegation into the next. Its own ReAct loop runs for up to 25 steps.
Orchestration flow: User → Coordinator → delegates to Agent A and Agent B → results merge → Coordinator synthesizes → Final Response.

Supervisor strategy: coordinator delegates to specialized agents

Each delegation creates a child execution context with an incremented depth (max depth: 3, preventing infinite recursive delegation). The child context gets a budget allocation from the parent’s remaining token budget. Entity agents share the parent’s abort signal, so cancelling the orchestration cancels all active entity runs. The coordinator’s system prompt is auto-generated from the entity role descriptions. Write specific, non-overlapping role descriptions to help the coordinator make clear routing decisions. “Handles billing inquiries, invoices, and payment issues” routes better than “Handles customer questions.”

Sequential Strategy

The Sequential strategy runs entity agents one after another in position order. The first agent receives the user’s message as input. Each subsequent agent receives the previous agent’s output as its input. If any agent in the chain fails, the entire orchestration fails immediately. This is ideal for multi-stage processing pipelines where each stage transforms or enriches the data.
Example: Document processing pipelineAgent 1 (Extractor): extracts key facts from a document. Agent 2 (Analyzer): identifies risks and opportunities from the extracted facts. Agent 3 (Writer): produces a formatted executive summary from the analysis.

Parallel Strategy

The Parallel strategy runs all entity agents concurrently on the same input using a thread pool. Each agent processes the user’s message independently with its own tools and knowledge bases. If there is only one entity, its output is returned directly. If there are multiple entities, after all agents complete, a merge agent (gpt-4.1-mini by default, configurable via orchestration settings) combines their outputs into a single coherent response. If any agent fails, the entire orchestration fails.

Entity Configuration

Each entity in an orchestration has a role description and optional configuration. The role description is critical for the Supervisor strategy, since it tells the coordinator what the entity specializes in. For Sequential and Parallel, the role is descriptive metadata. Entity config can override max_steps (default 10) to control how many ReAct iterations the entity agent runs.

Streaming Events

Orchestration streaming exposes the full execution flow via SSE. For the Supervisor strategy, you see delegation events as the coordinator routes tasks to entities. For Sequential, you see step events as each agent runs. For Parallel, events from concurrent agents may interleave.

Limits

Next Steps

Orchestration Guide

Create an orchestration and run it step by step.

Agents & Tools

Understand the ReAct loop and tool system that powers each entity.

Workflows

For deterministic multi-step pipelines, use workflows instead.

Orchestrations API Reference

Full endpoint documentation.