An OpenCode V2 plugin that runs deterministic multi-agent workflows. A workflow is an ordered list of phases. A phase either prompts one child session or fans out to several in parallel and joins their results. Each phase writes an artifact, so a run is auditable and resumable.
mkdir -p ~/.config/opencode/plugins
curl -fsSL \
https://raw.githubusercontent.com/jadmadi/opencode-workflows/main/workflows.ts \
-o ~/.config/opencode/plugins/workflows.tsFor one project, put it in .opencode/plugins/. Tested against OpenCode
0.0.0-beta-19425.
| Command | Effect |
|---|---|
/workflow or /workflow list |
List the built-in workflows |
/workflow run <name> <task> |
Run a workflow for the task |
/workflow run <name> <task> --resume=<runID> |
Resume an unfinished run |
A resume may omit the task. The run directory stores it in 00-task.txt, and a
taskless resume reads it back.
First built-in: deep-research, with the phases brief, plan, research, reflect,
write, and review. It produces one Markdown report. fact-check is a follow-up.
- Each phase creates child sessions with
ctx.session.create, selects an agent withctx.session.switchAgent, sends the prompt withctx.session.prompt, and waits withctx.session.wait. - A fan-out phase runs several children in parallel, bounded by
WORKFLOW_CONCURRENCY(default 3), and joins their replies. - A failed phase retries up to
WORKFLOW_RETRIES(default 2) before the run stops and reports. An empty reply from a child counts as a failure. - Child sessions use the invoking session's model.
WORKFLOW_MODELoverrides it with aprovider/modelref. - Artifacts go under
<data dir>/opencode/workflows/<runID>/.WORKFLOW_ROOToverrides the parent.
bun testInspired by MiMoCode's workflows. See NOTICE.
MIT