Skip to main content
Molecules are Beads’ advanced workflow feature for managing complex, multi-issue work. They allow you to group related issues, track progress, and create reusable workflow templates.

What are molecules?

A molecule is a collection of related issues that form a cohesive workflow:
  • Formula: A template defining the workflow structure
  • Proto: An uninstantiated formula (not yet poured)
  • Molecule: A spawned instance with actual issues
  • Bond: A link between issues in the molecule
Think of molecules as “advanced epics” with formal structure and reusable templates.

Core concepts

Formulas

Formulas are YAML files defining workflow structure:

Lifecycle

  1. Seed: Verify formula is valid (bd mol seed)
  2. Pour: Instantiate formula into actual issues (bd mol pour)
  3. Bond: Link issues together (bd mol bond)
  4. Current: Track position in workflow (bd mol current)
  5. Distill: Extract formula from existing molecule (bd mol distill)

Mol seed: Formula verification

bd mol seed verifies formulas can be cooked:
Use cases:
  • CI/CD pre-flight checks
  • Debugging formula syntax
  • Validating formula before distribution

Mol bond: Linking issues

bd mol bond creates relationships between issues:

Sequential bonding

Create linear workflow:

Parallel bonding

Create parallel work:

Conditional bonding

Create conditional workflows:

Polymorphic bonding

Bond accepts multiple operand types:

Phase control

Control when bonds become permanent:
Ephemeral bonds are automatically cleaned up by bd mol distill or bd purge.

Mol current: Position tracking

bd mol current shows your position in a molecule workflow:

Large molecule handling

For molecules with 100+ steps:

Multi-agent coordination

Mol distill: Formula extraction

bd mol distill reverse-engineers a formula from an existing molecule:

Variable substitution

Distill detects repeated patterns:

Use cases

Capture tribal knowledge:
Organization standards:
Emergency response templates:

Workflow patterns

Pipeline composition

Compose workflows from smaller pieces:

Progressive enhancement

Start minimal, add steps:

Patrol workflows

Repetitive maintenance tasks:

The Christmas Ornament pattern

Dynamic bonding with custom IDs:

Best practices

For formula authors

  • ✅ Keep formulas focused (5-10 steps max)
  • ✅ Use variables for reusability
  • ✅ Document formula purpose in YAML comments
  • ✅ Test formulas with bd mol seed before distribution
  • ✅ Version control formulas in .beads/formulas/

For formula users

  • ✅ Use bd mol current to track progress
  • ✅ Pour from trusted formulas only
  • ✅ Customize poured molecules as needed
  • ✅ Distill successful workflows for reuse
  • ✅ Clean up ephemeral bonds with bd purge

For teams

  • ✅ Maintain formula library in .beads/formulas/
  • ✅ Document formula usage in README
  • ✅ Review formula changes in PRs
  • ✅ Use bd mol seed in CI to validate formulas
  • ✅ Share successful workflows via distill

Troubleshooting

Formula not found

Symptom: bd mol seed reports “formula not found” Solution: Check search paths:

Circular dependencies

Symptom: bd mol pour fails with “circular dependency detected” Solution: Check formula for cycles:

Bond failed: issues already linked

Symptom: bd mol bond fails with “dependency already exists” Solution: Remove existing dependency first:

See also