Skip to content

Real Examples

Lex edited this page Aug 15, 2026 · 1 revision

Real Examples

Example 1: dependency audit (your first graph)

The spec from Authoring Workflows — two nodes, one edge. Run it on any repository:

/dag-flow run the dependency-audit workflow

What you should see in dag.open:

  1. inventory goes queued → running → completed in a few seconds; its output is a list of manifests.
  2. report admits once inventory completes, reads {{inventory}} in its prompt, and returns the flagged dependencies with an upgrade order.
  3. The workflow completes and the parent is woken with the report.

This is the smallest honest graph: an edge that exists because the report actually consumes the inventory.

Example 2: a deep fix, from a real run

A user reported that resuming a session made it unresponsive: messages were sent, nothing happened, and restarting revealed they had arrived. The whole investigation ran as one workflow. Abbreviated transcript:

reproduce-defect   RED tests: id ordering across a timestamp wrap boundary
deep-impact-audit  every lexicographic id comparison in the codebase, classified
repair-defect      raw-millisecond generator + time-based comparisons
verify-repair      mutation proof: revert the fix → tests go red; restore → green
review-repair      REJECT — one hardening commit lacked a falsifiable probe
(H1 probe added, scratch-workspace revert turns it red)
review (re-run)    ACCEPT

Things worth noticing in that transcript:

  • The REJECT was correct. The review found a commit whose revert left the suite green — a barrier that cannot fail also cannot protect. The fix loop added the missing probe and re-ran. This is the system working, not the system failing.
  • The revision view earned its keep. The rejected round and its retry do not clutter the final graph; the workflow reports completed on the version that actually passed.
  • The verify node ran a mutation proof: revert the fix in a scratch workspace, watch the regression tests fail, restore byte-identical, watch them pass. Evidence, not assurance.

Example 3: reports as files

A synthesis node ends with:

Write the final report to /path/to/repo/.opencode/workflow-reports/fix-report.md
and reply with exactly that absolute path.

The runtime captures {content_ref, size, sha256, summary}; workflow(action="result") returns the pointer with a short summary. The parent reads the file when it needs the detail. The transcript stays small, and the hash recorded at capture time proves the file was not edited afterwards.

Where to find more

The builtin workflow library (workflow(action="list")) ships reference topologies — design deep-dive, parallel delivery, deep review, compact change review — each a readable spec you can copy and bend.

Clone this wiki locally