Skip to main content
This guide walks you through building a real orchestrator agent that calls multiple sub-agents to perform a comprehensive security review. By the end, you’ll have a working 3-agent pipeline deployed on orchagent.

What You’ll Build

The orchestrator calls both sub-agents in parallel, combines their results, and returns a unified security report. Prerequisites: orch login completed, an Anthropic or OpenAI API key in your vault (orch secrets set ANTHROPIC_API_KEY sk-ant-...).
Want to skip the setup? Use orch init my-orchestrator --template fan-out to scaffold a complete parallel orchestrator instantly. Templates are also available for pipeline (sequential) and map-reduce patterns. See Building an Orchestrator for details.

Step 1: Create the Leaf Agents

Leaf agents do focused, single tasks. Start with these two.

leak-finder (code runtime)

orchagent.json:
main.py:
schema.json:
Agents are callable by default. You only need to set "callable": false to explicitly opt out (e.g., for always-on services).

vuln-scanner (direct LLM)

A simple prompt-based agent that uses an LLM to analyze code for vulnerabilities.
orchagent.json:
prompt.md:

Step 2: Create the Orchestrator

orchagent.json:
Replace yourorg with your actual org slug (shown in orch whoami).
main.py:
requirements.txt:

Step 3: Run It

The orchestrator will:
  1. Receive the input
  2. Call leak-finder and vuln-scanner in parallel
  3. Wait for both to complete
  4. Return the combined security report

Step 4: Automate It

Cron schedule (daily scan)

Webhook trigger (on PR events)


Key Concepts Recap

Troubleshooting

“DEPENDENCY_NOT_ALLOWED” error?
  • The agent you’re calling isn’t in your manifest.dependencies array
“Agent not callable” error?
  • The sub-agent has "callable": false set explicitly — remove it or set to true and republish
Timeout errors?
  • Your orchestrator’s timeout_seconds must be larger than the sum of all sequential sub-agent calls
  • Use parallel calls (asyncio.gather) when sub-agents are independent
SDK not found in sandbox?
  • Add orchagent-sdk to your requirements.txt (Python) or package.json (JS)

Next Steps

Orchestration Reference

Full orchestration API: skills, call patterns, rate limits

SDK Reference

Complete Python and JavaScript SDK docs