Workflows
A workflow runs your agents step by step. It is a YAML file in the workflows folder of your vault, and you can build it in a visual editor.
The parts of a workflow
| Part | Meaning |
|---|---|
| Agent step | Starts one agent with a skill or a prompt, for example "plan the task" |
| Gate | Stops the run and waits for your decision. See Gates and branches. |
| Workflow step | Runs each step of another workflow at this place |
| Task file | The task that the run works on. Each run needs one. |
The editor
Open the Workflows area. The bar at the top holds the field Workflow: select a workflow there, or type a part of its name. The flow below the bar shows the steps from the trigger to the end. The side panel at the right shows the form of the selected step. The area opens the last workflow of the vault again at the next visit.
- Add a step: select the + between two steps.
- Add a gate: select the shield symbol between two steps.
- Change a step: select the step. A form opens at the right.
- Change the order: use the arrows at the top of the form.
- Skip a step: clear the check box at the left of the headline of a step card. The next run skips the step. A checked box runs the step. The box changes the same value as the skip option in the form of the step.
- Create a workflow: write a name into the field New workflow in the bar, and select the +.
- Delete a workflow: select the trash button next to the field Workflow.
Save writes the file. Discard removes your changes. YAML opens the file in the file panel.
The form of an agent step
| Field | Meaning |
|---|---|
| Id | The name of the step. It must be unique in the workflow. |
| Agent and model | Who does the step |
| Skill prompt | The instruction as text |
| Skill file | A file with the instruction. The prompt wins when both have a value. |
| Run condition | Always, or only when a review found something |
| Branch | The step runs only for some decisions of a gate |
| Status at the start, Status after success | The workflow state of the task during the step and after it. Empty fields use the contract opfold.yaml of the skill, and the placeholder shows its value. |
| Task state at the start, Task state after success | The task state of a task step. Empty fields use the contract of the skill. |
Start a run
- Select the workflow.
- In the Run panel, select the Task file. Fill the variables when the workflow has some.
- Select Run.
Dry run prints what the run does and starts no agent.
You can start the workflow again while a run works. Select another task file and select Run again. The same workflow then works on two tasks at the same time.
Below the fields, the list Active runs shows each run of the workflow that works or waits. Select a row to open the run in the Runs tab. The notice after a start also has the button Open the run. In the Runs tab, you stop a run and answer its gates.
The plan before a run
Before a run starts, Opfold shows its plan:
- each step with its agent and its model,
- the token use of the last run of this workflow,
- the result of the checks.
| Check | A problem means |
|---|---|
| Skill files | A step names a skill file that does not exist. |
| Agents | Opfold cannot find the program of an agent. |
| Second run | Another run already works on this task. |
| Task states | The skill of a step does not accept the task state that the step before it leaves. The contracts opfold.yaml of the skills give the states. The step form shows the same warning. |
| Repository | Your local copy is behind the main branch. |
| Usage | A limit of an agent is almost reached. |
Select Once to start the run, Always to start this workflow without the plan from now on, or Deny.
Watch a step
Above each step in the flow you find two switches. Pause before stops the run before the step and waits for you. Notify after sends you a notice when the step ends. The switches in the flow apply to the next run that you start.
To change the switches of a run that works or waits, open the run in the Runs tab. Each step that did not start yet shows the same two switches there.
Skills
A skill is a Markdown file with instructions for an agent. A step names its skill relative to the skills folder of the vault. Select Settings in the Workflows area to change that folder.
Next
- Gates and branches
- Runs
- Workflow file lists each key of the file.