Agent resource (delegation)
The agent: resource calls a sibling agent's entire workflow within the same agency and returns that agent's apiResponse output. It is how one agent delegates a subtask to another specialized agent.
Where it runs
Both workflow mode and agent mode. Only valid between agents bundled in the same agency.yaml - see Agencies for how agents are grouped and discover each other.
Basic usage
yaml
# resources/delegate.yaml
actionId: delegate
name: Ask the Research Agent
agent:
name: research-agent # metadata.name of the target agent in agency.yaml
params:
topic: "{{ get('q') }}"
depth: deepyaml
# resources/respond.yaml
actionId: respond
requires: [delegate]
apiResponse:
success: true
response:
result: "{{ output('delegate') }}"Configuration options
| Option | Description |
|---|---|
name | metadata.name of the target agent's workflow, as declared in agency.yaml (required) |
params | Key-value pairs forwarded to the target agent. The target agent reads them via get('key'), same as it would read HTTP request fields |
Output
The target agent's own apiResponse output, unchanged - whatever shape that agent returns is what output('delegate') gives you here.
See also
- Agencies - multi-agent orchestration, how agents are bundled and named
- Component resource - call a reusable resource bundle instead of a full sibling agent
- Resources overview - all resource types
