Every stage in a Trak’s pipeline — what agent runs, what gates check the output, what capabilities it has, and what happens on failure — is configured in .orkestra/workflow.yaml.
File structure
A workflow.yaml file contains one or more named flows. A Trak is assigned to a flow at creation time and runs the flow’s stages in order.
version: 2
flows:
default:
stages:
- name: work
artifact: summary
prompt: worker.md
integration:
on_failure: work
Root fields
| Field | Type | Required | Description |
|---|---|---|---|
version | integer | No | Schema version. Current value: 2. Defaults to 2 if omitted. |
flows | map | Yes | Named flows. At least one flow is required. |
Flow fields
Each entry under flows is a named flow:
| Field | Type | Required | Description |
|---|---|---|---|
stages | list | Yes | Ordered list of stage configs. At least one stage is required. |
integration | object | Yes | Merge behavior configuration. |
Integration fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
on_failure | string | Yes | — | Name of the stage to return to when a merge fails. Must match an existing stage name in this flow. |
auto_merge | boolean | No | false | If true, merges the Trak’s branch automatically when the final stage completes. |
Stage fields
Each item in stages configures one stage in the flow:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Unique identifier within the flow. Shown in CLI output and logs. |
artifact | string | Yes | — | Name under which the stage’s output is stored and injected into later stages as context. Must be unique within the flow. Reserved values: activity_log, trak. |
description | string | No | — | Human-readable description. Shown in UI and logs. |
prompt | string | No | {name}.md | Path to the prompt template, relative to .orkestra/agents/. Defaults to {name}.md. |
model | string | No | Default | AI model to use. See Model values. |
capabilities | object | No | — | Optional extensions to stage behavior. See Capabilities. |
gate | boolean or object | No | — | Gate that runs after the agent produces output. true for an agentic gate; an object for an automated gate. See Gate fields. |
disallowed_tools | list | No | [] | Tools the agent cannot use. See Tool restrictions. |
schema_file | string | No | — | Path to a custom JSON schema for the stage output, relative to .orkestra/schemas/. If omitted, Orkestra generates a schema from the stage’s capabilities. |
Model values
The model field selects both the AI provider and the model. The provider is inferred from the model name.
| Value | Provider | Model |
|---|---|---|
| (omitted) | Claude Code | Default model |
sonnet | Claude Code | Claude Sonnet 4 |
opus | Claude Code | Claude Opus 4 |
haiku | Claude Code | Claude Haiku 4.5 |
claudecode/sonnet | Claude Code | Claude Sonnet 4 |
claudecode/opus | Claude Code | Claude Opus 4 |
claudecode/haiku | Claude Code | Claude Haiku 4.5 |
Full model ID (e.g., claude-sonnet-4-6) | Claude Code | Specific version |
kimi-k2 | OpenCode | Kimi K2 |
opencode/kimi-k2 | OpenCode | Kimi K2 |
Capabilities
The capabilities object extends what a stage can do:
| Field | Type | Default | Description |
|---|---|---|---|
subtasks | object | — | Allows the agent to decompose the Trak into child Traks (Subtraks). See Subtraks capability. |
Subtraks capability
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
flow | string | No | default | The flow assigned to child Traks. Must be a named flow in workflow.yaml. |
Gate fields
The gate field takes one of two forms.
Agentic gate (gate: true) — the agent produces an approve or reject verdict. On reject, the agent specifies which earlier stage to route back to. If the Trak is not in auto mode, a human must confirm before routing executes.
gate: true
Automated gate (gate: { command, ... }) — a shell script runs after the agent produces output:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
command | string | Yes | — | Shell command to execute in the Trak’s worktree. Exit 0 passes; non-zero fails and sends the output to the agent as feedback. |
timeout_seconds | integer | No | 300 | Seconds before the gate is treated as failed. Must be greater than 0. |
See Gates for gate behavior and environment variables.
Tool restrictions
Each item in disallowed_tools restricts the agent from using a specific tool:
| Field | Type | Required | Description |
|---|---|---|---|
pattern | string | Yes | Tool name or pattern in Claude Code format (e.g., Bash(cargo *), Edit). Cannot be empty. |
message | string | No | Explanation injected into the agent’s prompt describing why this tool is restricted. Helps the agent work around the restriction. |
Available tool patterns include: Bash, Bash(<pattern>), Edit, Write, Read, Glob, Grep. Any Claude Code tool name is a valid pattern.
Validation
Orkestra validates workflow.yaml at startup and reports errors immediately:
- Stage
namemust be unique within a flow. - Stage
artifactmust be unique within a flow.activity_logandtrakare reserved. integration.on_failuremust name an existing stage in the flow.subtasks.flowmust name an existing flow (if specified).gate.timeout_secondsmust be greater than 0.disallowed_tools[].patterncannot be empty.
Full example
The default workflow.yaml created by Orkestra on first run:
version: 2
flows:
# Default pipeline — used for most Traks
default:
stages:
# Planning: produces an implementation plan after clarifying requirements
- name: planning
artifact: plan
description: Clarifies requirements and produces an implementation plan
prompt: planner.md
# Breakdown: researches the codebase and proposes Subtraks
- name: breakdown
artifact: breakdown
description: Breaks the plan into parallel implementation Subtraks
prompt: breakdown.md
capabilities:
subtasks:
flow: subtask # Subtraks use the subtask flow below
# Work: agent implements the changes; automated gate verifies quality
- name: work
artifact: summary
description: Implements code changes and produces a summary
prompt: worker.md
gate:
command: "$ORKESTRA_PROJECT_ROOT/.orkestra/scripts/checks.sh"
timeout_seconds: 600 # 10 minutes; adjust for your project's test suite
# Review: agentic gate — agent produces an approve/reject verdict
- name: review
artifact: verdict
description: Reviews completed work and produces an approve/reject verdict
prompt: reviewer.md
gate: true # Agentic gate: agent evaluates, human confirms
# Compound: captures learnings from the completed Trak
- name: compound
artifact: learnings
description: Captures learnings to improve future Traks
prompt: compound.md
integration:
on_failure: work # If merge fails, route back to the work stage
# Subtrak pipeline — simpler flow for child Traks
subtask:
stages:
- name: work
artifact: summary
prompt: worker.md
gate:
command: "$ORKESTRA_PROJECT_ROOT/.orkestra/scripts/checks.sh"
timeout_seconds: 600
- name: review
artifact: verdict
prompt: reviewer.md
gate: true
integration:
on_failure: work