Skip to main content
Formulas are declarative workflow templates.

Formula Format

Formulas can be written in TOML (preferred) or JSON:

TOML Format

JSON Format

Formula Types

Variables

Define variables with defaults and constraints:
Use variables in steps:

Step Types

A step’s type sets the issue type of the bead it creates: task (default), bug, feature, epic, chore, gate, or a custom type registered in types.custom. At bd mol pour and bd cook --persist, a type that is neither built in nor registered falls back to task with a warning. type = "gate" has two forms:
  • With a [steps.gate] block (an exit-gate): the step becomes a task bead holding the preparation work, plus a companion gate bead that the task blocks. Other steps that reference the step id wait for both, so they run only after the work is done and the gate is resolved.
  • Without a [steps.gate] block: the step becomes a single gate bead with no await condition. It is hidden from bd ready and is resolved by hand.
Async waits and sign-offs are expressed with a [steps.gate] block — see Gates and Gates in formulas.

Dependencies

Sequential

Parallel then Join

Conditional steps

A step with a condition is left out of a pour when the condition evaluates false against the pour’s variables, and its children go with it:
Nothing names deploy, so leaving it out changes nothing else. A step that stays in the pour should not name a step the pour leaves out in its needs, depends_on, or waits_for spawner: in releases after v1.3.2 the pour fails with a formula validation error naming both steps and the condition (v1.3.2 and earlier pour the step with that dependency silently dropped). Give the dependent step the same condition, or depend only on steps that are always poured.

Gates

Add gates for async coordination. A [steps.gate] on an ordinary step is an entry-gate: the step waits for the gate before it can start.
On a step declared type = "gate" it is an exit-gate: the step is the preparation work for the gate’s decision, and its task blocks the gate. Steps that reference it wait for both that work and the gate.

Aspects (Cross-cutting)

Apply transformations to matching steps:

Formula Locations

Formulas are searched in order:
  1. .beads/formulas/ (project-level)
  2. ~/.beads/formulas/ (user-level)
bd formula list shows everything visible on the search paths.

Using Formulas

Creating Custom Formulas

  1. Create file: .beads/formulas/my-workflow.formula.toml
  2. Define structure (see examples above)
  3. Use with: bd cook my-workflow then bd mol pour <proto-id>

Example: Release Formula