← Lab
Experiment·Agentic Systems & Orchestration·4 min read

A2A Orchestrator & Worker

How agent-to-agent delegation works when the two agents were not written by the same team — discovery, task state, and the limits that keep it safe.

A2A Orchestrator & Worker

A2A exists so an orchestrator can delegate to a worker it did not write. The worker publishes what it can do; the orchestrator matches a sub-task to a declared skill and hands it over with an identifier it controls.

Discovery through the agent card

A worker serves an agent card describing its name, version, capabilities (streaming, push notifications) and skills, each with declared input and output modes. The orchestrator fetches it and negotiates: use streaming if both support it, fall back if not.

Task state is the contract

01submittedOrchestrator sends the task with an id it generated, so the run is resumable if the worker dies.
02workingWorker acknowledges and streams partial results as they arrive.
03completed / failedA terminal state. The orchestrator stops polling — this is what prevents an accidental infinite wait.

Generating the task id on the orchestrator side matters more than it looks. It means a worker restart does not lose the task, and a duplicate send is idempotent rather than a second unit of work.

The limits that keep delegation safe

  • Cap delegations per run — a fixed budget, not an emergent one.
  • A worker must never be able to start another orchestrator; that is how depth becomes unbounded.
  • Every delegation inherits the parent run's deadline rather than getting a fresh one.
What to take away
  • The agent card is how capability negotiation stays version-safe.
  • Generate the task id on the caller side for resumability.
  • Terminal states are what stop the orchestrator polling forever.
  • Cap delegation depth and inherit the parent deadline.

Field notes on building production AI systems — collected, verified and written up so they are useful to anyone working on the same problems.

smoke
“Innovation distinguishes between a leader and a follower.”

Need an AI system that holds up in production? Tell me what breaks today and I'll tell you what I'd build.

Call Me now !

mail

abdelmajidzaddi088@gmail.com

address

Mohammedia, Morocco

phone

+212 695 557 631