Task Graph YAML Schema
This page documents the YAML schema accepted by
agentrelay.task_graph.TaskGraphBuilder.from_yaml(...).
Top-level object
Required keys:
name: non-empty string.tasks: non-empty list of task objects.
Optional keys:
workstreams: non-empty list of workstream objects.max_workstream_depth: integer > 0. Default:1.
Unknown top-level keys are rejected by TaskGraphBuilder.
Operational keys
The following top-level keys are not part of the graph schema but are
recognized by run_graph.py, which extracts them before passing the dict to
TaskGraphBuilder.from_dict():
tmux_session: string. Override tmux session name for all agents.keep_panes: boolean. Leave agent tmux windows open after completion.model: string. Override model for all agents.
These can also be set via CLI flags (--tmux-session, --model). CLI flags
take precedence over YAML values.
Task object
Required keys:
id: non-empty string, unique withintasks.
Optional keys:
role: string. Defaults togeneric. Accepts enum value (implementer) or enum name (IMPLEMENTER).description: string ornull.dependencies: list of task IDs. Default:[].paths: object with optionalsrc,test,spec.completion_gate: string ornull.max_gate_attempts: integer > 0 ornull.primary_agent: object with optionalframework,model,adr_verbosity,environment.review: object with requiredagentand optionalreview_on_attempt(default1).workstream_id: string ornull. Defaults todefault.
Validation rules:
- Dependency IDs must exist in
tasks. - Dependency graph must be acyclic.
- Duplicate dependency IDs in one task are rejected.
- Unknown task keys are rejected.
Workstream object
Required keys:
id: non-empty string, unique withinworkstreams.
Optional keys:
parent_workstream_id: string ornull.base_branch: non-empty string. Default:main.merge_target_branch: non-empty string. Default:main.
Validation rules:
parent_workstream_idmust reference an existing workstream ID.- Workstream parent hierarchy must be acyclic.
- Workstream parent depth must be
<= max_workstream_depth.
Important defaulting behavior
- If
workstreamsis omitted, a syntheticdefaultworkstream is used. task.workstream_iddefaults todefault.- If
workstreamsis provided and tasks omitworkstream_id, those tasks still resolve todefault. - That means if you provide explicit
workstreams, includeid: defaultwhen you want omittedworkstream_idtasks to remain valid.
Agent/review defaults (current implementation)
primary_agent.framework:claude_codeprimary_agent.adr_verbosity:noneprimary_agent.environment: tmux sessionagentrelayreview.review_on_attempt:1
Canonical examples
- Minimal graph: docs/examples/minimal.yaml
- Parent/child workstreams: docs/examples/workstreams.yaml
- Mixed default + explicit workstreams: docs/examples/mixed-default-and-explicit-workstreams.yaml