Skip to content

Three Ways to Run

ModeMethodWhen to useExample
Single agentrunAgent()One agent, one promptbasics/single-agent
Auto-orchestrated teamrunTeam()Give a goal, let the coordinator plan and executebasics/team-collaboration
Explicit pipelinerunTasks()You define the task graph and assignmentsbasics/task-pipeline

For answers that need scrutiny, runConsensus() runs a proposer→judge verification loop (with an opt-in per-task verify hook). See Consensus.

Preview the coordinator’s task DAG without executing it, or pin that plan and replay the same graph later without another coordinator call:

// Decompose once and review the plan
const preview = await orchestrator.runTeam(team, goal, { planOnly: true })
// Turn it into a diffable, version-controllable artifact (plain JSON)
const plan = orchestrator.createPlanArtifact(preview)
// Later: replay the exact graph (same task ids, deps, assignees), no coordinator
const result = await orchestrator.runFromPlan(team, plan)

Route orchestration phases to different models with an opt-in modelRouting policy: a flagship model plans, a cheap model runs the leaf tasks. Match by phase, agent, task role/priority, or leaf status; first match wins, and omitting it leaves model selection unchanged. See Model routing.