Module orchestration
Expand description
Agent orchestration — invoke an agent in a Mode.
An agent is a value (TextAgent — a local agent, a composed pipeline, or a
remote A2A agent). Orchestration is the single question of how you invoke
it; the result always lands in governed State under {name}:result (or
{name}:error), so coordination is reactive and uniform regardless of the
invoker (the model, a Flow, an Extract, or a watcher).
| Mode | Sync? | Lowers to |
|---|---|---|
Mode::Call | sync — caller awaits | call (agent-as-tool, awaited inline) |
Mode::Dispatch | async, fire-and-forget | BackgroundAgentDispatcher::dispatch |
Mode::Background | async, model-aware | an agent-tool marked ToolExecutionMode::Background |
All three write {name}:result, so a Flow step can complete on a resolved
result via Guard::resolved, and any
consumer reads the value the same way.
Structs§
- Resolver
- A named async value source whose inputs come from
Stateand whose result lands back inStateunder{name}:result(or{name}:error).
Enums§
- Mode
- How an agent is invoked.
Functions§
- call
- Invoke
agentsynchronously: run it to completion, write its result to{name}:result(or its error to{name}:error), and return the result. - error_
key - State key an agent’s error is written to.
- provenance
- The provenance source of a value at
key(e.g."agent","fetch","llm", or"extraction"), if one was recorded understate_meta:{key}. - result_
key - State key an agent’s successful result is written to.