Skip to content

Agent resource (delegation) reference ​

This page lists every field and option. The overview shows what it does and a first example.

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 ​

It runs in a workflow. It is valid only between agents in the same agency.yaml. Agencies shows how to put agents in a group and how they find 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
flow:
  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 apiResponse output of the target agent, with no change. output('delegate') gives you the same shape that the agent returns.

Parallel calls ​

agent: calls that don't depend on each other run at the same time, each on its own engine. A panel of reviewer agents takes as long as the slowest one:

yaml
# resources/review-scope.yaml - one file per reviewer; all three start together
actionId: reviewScope
name: Scope review
agent:
  name: reviewer-agent
  params:
    focus: scope
    draft: "{{ get('q') }}"
---
# resources/report.yaml - starts once every review is back
actionId: report
name: Report
flow:
  requires: [reviewScope, reviewRisks, reviewClarity]
apiResponse:
  success: true
  response:
    scope: "{{ output('reviewScope') }}"
    risks: "{{ output('reviewRisks') }}"
    clarity: "{{ output('reviewClarity') }}"

Execution flow tells how many run at the same time, and what runs alone.

See also ​

kdeps has the Apache 2.0 License.