Workflow graphs for OpenCode V2. A run is an Effect. The plugin is an Effect plugin. Checkpoints are deferred values. Cancel interrupts the fiber.
opencode plugin add @phall1/opencode-workflowsOr load the package from this repo:
The CLI loads ./tui from the same package. Do not add it to cli.json.
/workflow list
/workflow ping hi start (finishes immediately)
/workflow echo hi talks in this session
/workflow autoplan <task> start
/workflow status
/workflow cancel
/workflow answer { ... }
/workflow-graph session panel
The model uses the workflow tool (list, start, status, cancel,
submit, answer).
| Name | What it does |
|---|---|
ping |
Compute-only. Finishes in this chat so you can see a done run. |
echo |
One agent step in this session |
wire |
Add this plugin to ~/dotfiles OpenCode config, apply, prove it loads |
autoplan |
Intent → candidates → choose → plan → summary |
autodoc |
Record an existing plan in docs |
autoimplement |
Implement, verify, fix loop |
sanity-check |
Read-only keep/simplify/refactor/drop/needs_evidence |
monitor |
Observe → wait or act → loop |
ship |
autoplan → autodoc → autoimplement |
Project files in .opencode/workflows/*.workflow.ts override bundled names.
import { agent, defineWorkflow, includeWorkflow } from "@phall1/opencode-workflows/dsl"
export default defineWorkflow({
name: "echo",
startAt: "reply",
nodes: {
reply: agent({
prompt: ({ input }) => `Answer concisely: ${(input as { task?: string }).task}`,
}),
},
edges: [],
})/workflow kicks off a run and returns. Agent steps default to a child
session, so this chat stays yours. Use session: "origin" only when a step
must read this conversation (autoplan capture). The graph panel is the progress UI, not a hijacked turn. The side panel is the step list. f opens the Merman graph when the run is too long to draw beside it. ↑↓ select, enter opens a child session, a answers a checkpoint, x stops. The footer chip opens it. decision is a Jev
Choice when TYPESAFE_API_KEY is set, otherwise generate.text. Below
minConfidence the graph gets uncertain. wait sleeps on the OpenCode
service. includeWorkflow runs a child graph and routes on named exits.
See docs/ARCHITECTURE.md.
{ "plugins": ["./packages/workflows"] }