Formula Format
Formulas can be written in TOML (preferred) or JSON:TOML Format
JSON Format
Formula Types
Variables
Define variables with defaults and constraints:Step Types
A step’stype 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 ataskbead holding the preparation work, plus a companiongatebead 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 singlegatebead with no await condition. It is hidden frombd readyand is resolved by hand.
[steps.gate] block — see
Gates and Gates in formulas.
Dependencies
Sequential
Parallel then Join
Conditional steps
A step with acondition is left out of a pour when the condition evaluates
false against the pour’s variables, and its children go with it:
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.
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:.beads/formulas/(project-level)~/.beads/formulas/(user-level)
bd formula list shows everything visible on the search paths.
Using Formulas
Creating Custom Formulas
- Create file:
.beads/formulas/my-workflow.formula.toml - Define structure (see examples above)
- Use with:
bd cook my-workflowthenbd mol pour <proto-id>