Store workflow definitions as table rows and drop YAML

This commit is contained in:
Ian Gulliver
2026-10-20 21:30:39 -07:00
parent 5823af6ff9
commit 32ebf08b66
17 changed files with 624 additions and 454 deletions
@@ -1,6 +1,6 @@
# Workflow files
# Workflow definitions
A workflow's file is YAML: an optional `description`, then `steps`, which run in order. The workflow's name is not in the file. Unknown fields are refused.
A workflow's definition is an object: an optional `description`, then `steps`, which run in order. The workflow's name is not in it. `save_workflow` takes it as its `definition` argument and `read_workflow` returns it, both as JSON. Unknown fields are refused.
Any workflow can run on a brief, each stage as its own task, and any workflow whose stages are single agents can be a project's review workflow (set with `set_review_workflow`), which reviews its tasks' snapshots: each stage is then one reviewer agent on its `model`, given the task's change and its stage's `prompt` (what to look for), and a stage after others also gets their reviews. A project can't review with a workflow that has a team stage (`agents`).
@@ -22,26 +22,19 @@ A stage gets the outputs of the stages that end the step before it: the last sta
Where a stage's task branches from follows from the shape. A stage after exactly one stage starts from the commit that stage finished at. A stage after a `parallel` starts from the default branch and is told the branches it can merge. A stage with nothing before it starts where the workflow was started. A workflow is finished once every stage has finished; when it ends with a `parallel`, each branch's last stage keeps its task to merge, and the run's other stage tasks are discarded. A review is delivered to the task's agent, every stage's findings in one message, once every stage has reviewed. An `order` or `parallel` can't be empty.
```yaml
description: Build a change, review and test it in parallel, then fix what they found.
steps:
- stage: Build
model: claude-opus-5-5
prompt: Implement the brief.
- parallel:
- stage: Review
model: gpt-6.1-sol
prompt: Review the Build stage's work and list the problems.
- stage: Test
model: gemini-4-argon-high
prompt: Exercise the change and report what fails.
- stage: Fix
agents:
- name: fixer
model: claude-opus-5-5
prompt: Fix every problem the reports list.
- name: checker
model: gpt-6.1-sol
prompt: Check each fix as the fixer lands it.
prompt: Merge the branches you are given and address both reports.
```json
{
"description": "Build a change, review and test it in parallel, then fix what they found.",
"steps": [
{"stage": "Build", "model": "claude-opus-5-5", "prompt": "Implement the brief."},
{"parallel": [
{"stage": "Review", "model": "gpt-6.1-sol", "prompt": "Review the Build stage's work and list the problems."},
{"stage": "Test", "model": "gemini-4-argon-high", "prompt": "Exercise the change and report what fails."}
]},
{"stage": "Fix", "prompt": "Merge the branches you are given and address both reports.", "agents": [
{"name": "fixer", "model": "claude-opus-5-5", "prompt": "Fix every problem the reports list."},
{"name": "checker", "model": "gpt-6.1-sol", "prompt": "Check each fix as the fixer lands it."}
]}
]
}
```