Skip to content

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: deep
yaml
# resources/respond.yaml
actionId: respond
requires: [delegate]
apiResponse:
  success: true
  response:
    result: "{{ output('delegate') }}"

Configuration options

OptionDescription
namemetadata.name of the target agent's workflow, as declared in agency.yaml (required)
paramsKey-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

Released under the Apache 2.0 License.