Branching and Resume

Branching with match

match runs a check workflow that returns a JSON variant, then dispatches to the matching arm.

The check workflow must output:

{ "variant": "needs-work", "reason": "Tests are failing" }

Example — review code and branch on the result:

version 1

workflow review-check
  exec
    harness: claude
    prompt: |
      Review the code changes. Output JSON:
      {"variant": "approved"} or {"variant": "needs-work", "reason": "..."}

workflow fix-issues
  exec
    harness: claude
    prompt: "Fix the issues identified in the review."

workflow deploy
  exec
    harness: claude
    prompt: "Deploy the approved changes."

workflow main
  run implement
  match review-check
    approved  -> run deploy
    needs-work ->
      run fix-issues
      run deploy

The else arm is optional. Without it, o7 errors if the variant doesn't match any arm.

Rolling back

If a run goes wrong, reset to an earlier point:

o7 reset <run-id> <step-index>

Find the run ID and step index with o7 inspect. After reset, the run is paused at that boundary — resume with o7 resume.

Next steps

  • CLI Reference — complete command and DSL syntax reference
  • Use o7 wiz to configure additional harnesses