Workflow file
A workflow is a YAML file in the workflows folder of the vault, by default 00 Context/workflows. This page lists its keys.
Example
description: "Plan, approve, and implement a task"
agents:
claude:
command: claude
args: [--print, "{{promptFile}}"]
models:
opus: { args: [--model, opus] }
steps:
- id: planning
agent: claude
model: opus
skill: /task-planning/SKILL.md
- id: plan-approval
gate:
title: Is the plan final?
- id: implementing
agent: claude
skillPrompt: Implement the plan.
limits:
maxReviewFixCycles: 2
Top level
| Key | Meaning |
|---|---|
description |
One sentence about the workflow |
agents |
The agents that the steps can use |
steps |
The steps in their order |
defaults |
Values for each step: cwd, timeoutMs, model |
limits.maxReviewFixCycles |
How many times a review step and its fix step can repeat |
checks |
Commands that run after the steps. Each has an id and a command. |
completion.requireOutcome |
false turns off the result file of the agent. Without this key, an agent must write a result file. |
An agent
| Key | Meaning |
|---|---|
command |
The program of the agent |
args |
The arguments. {{promptFile}} is the file with the instruction of the step. {{model}} and {{effort}} are the model and the effort of the step. |
models |
Named models with their own arguments |
An agent step
| Key | Meaning |
|---|---|
id |
The unique name of the step |
agent |
An agent of the agents list, or llama-cpp for a local model. See the section A local model below. |
model, effort |
The model and the effort of the step |
skill |
A skill file, relative to the skills folder |
skillPrompt |
The instruction as text. It wins over skill. |
when |
always or review-has-findings |
cyclesWith |
The review step that this fix step repeats with |
on |
The branch of the step. See Gates and branches. |
hooks.pre |
A command before the prompt. Its output goes into the step context of the agent. A failed command stops the step. |
hooks.post |
A command after the step |
workflowStatus.start, workflowStatus.success |
The workflow state that the task gets at the start and at the end of the step |
taskStatus.start, taskStatus.success |
The task state that the task gets at the start and at the end of the step. Only a task step has it. |
expects |
The files that the step must write beside the task file |
The keys workflowStatus, taskStatus, and expects are optional. Without them, the step uses the values of the contract opfold.yaml of its skill. A value in the workflow file wins over the contract, so one skill can be a task step in one workflow and a sub step in another. See Skills.
Before the agent starts
For each agent step, Opfold does these things before the agent starts:
- It runs
hooks.pre. - It computes the step context: the task, the project, the personas, and the blocks of the skill contract.
- It checks the preconditions of the contract. A failed check stops the step, and no agent starts. The run shows the reason. Run again continues at this step after you fix the cause.
- It writes the start values of the step into the task file and an open entry into
timeline.json.
After the agent, Opfold ends the entry. For a successful step, Opfold writes the success values. For a step that does not succeed, Opfold writes the values from before the step again, so Run again passes the checks of the step. No agent writes a status field or a timeline.
A gate
| Key | Meaning |
|---|---|
gate.title |
The question for you |
gate.show |
Files that you read before the decision |
gate.options |
Your decisions. Each has id, label, and then. |
The value of then is continue, stop, or { rerun: <step id> }. An option with comment: required needs a comment from you.
A workflow step
| Key | Meaning |
|---|---|
workflow |
The file name of another workflow in the same folder |
overrides |
Changes for steps of that workflow: agent, model, effort, or skip: true |
The steps of the other workflow get the id of this step in front, for example planning.review.
A local model
The agent llama-cpp runs a step with a local model of llama.cpp. The workflow file needs no entry for this agent in the agents list. The plugin Local LLM must be on.
steps:
- id: drafting
agent: llama-cpp
model: Qwen3-8B-Q8_0
skill: drafting/SKILL.md
- The step needs its own
model. The model ofdefaultsnames a model of another agent, so it does not apply. - The Opfold app starts the llama.cpp server and loads the model. Thus a run with a local model must start in the app. A run from a terminal fails with a message.
- The step runs without a person, so the agent can change files and run commands without a question.
- The agent works in the vault folder. Its file tools read and change only the files of the vault.
- The time limit of the step is
defaults.timeoutMs. Without it, the limit is 30 minutes. - An entry
llama-cppin theagentslist replaces this agent.
Variables
A text such as ${TARGET} in the file is a variable. The Run panel asks for its value before a run.