Go to the content
DE Download
Pages of the documentation

Gates and branches

A gate keeps you in control of a workflow. A branch lets your decision select what the run does next.

A gate

A gate is a step that starts no agent. At a gate, the run stops, and Opfold sends you a notice. The run uses no agent and no limit while it waits.

- id: plan-approval
  gate:
    title: Is the plan final?

A gate without its own decisions has three:

Decision What the run does
Approve Continues with the next step
Request changes Runs the agent step before the gate again, with your comment
Stop the run Ends the run

Decide

  1. Open the Inbox. The gate shows under "Waiting on you".
  2. Read the summary and the files that the gate shows.
  3. Write a comment when you want changes.
  4. Select a decision.

Your own decisions

Select the gate in the editor. In the section Decisions, select Define own decisions. Each decision has an id, a label for its button, and an outcome.

Outcome What the run does
Continue the run Continues with the next step
Run other steps Runs only the steps that you select for this decision
Run an earlier step again Runs a step before the gate one more time
Stop the run Ends the run

A branch

With "Run other steps", a decision has its own path. The flow shows a fork below the gate: one column for each decision, and a line back to one flow after the columns.

You can also set the branch at the step: select the step, and in the section Branch add a condition, for example "When plan-approval is approved".

The same in the file

- id: plan-approval
  gate:
    title: Is the plan final?
    options:
      - { id: approved, label: Approve, then: continue }
      - { id: rework, label: Rework, then: continue }
      - { id: stop, label: Stop, then: stop }

- id: implementing
  agent: codex
  skillPrompt: Implement the plan.
  on: { plan-approval: approved }

- id: replanning
  agent: claude
  skillPrompt: Write the plan again.
  on: { plan-approval: rework }

Rules

  • A step without a branch always runs.
  • A step whose branch does not match your decision is skipped.
  • The key on names a gate that is before the step, and decisions that the gate has. Opfold refuses a workflow with a wrong name, so a wrong name cannot skip a path without a notice.
  • A value of on can be a list: on: { plan-approval: [approved, fast] }.
  • A dry run asks no human, so it runs each path.