Skip to main content

Synopsis

Merges multiple generated runbooks into a single runbook with conditional branching based on a variable value. Useful when the same workflow has different paths depending on input.

Required arguments

Optional arguments

If --branch-on or --case are omitted, the CLI enters interactive mode to collect them.

How it works

1

Collect inputs

The branch variable, cases, and goal are gathered (from CLI args or interactively).
2

Load runbooks

Each case’s YAML file is loaded and validated.
3

Merge variables

Variables from all cases are merged. The branch variable is added with source: prompt.
4

Build branches

All case steps are assembled into a single branches step.
5

Preview and edit

You can preview the composed runbook and make adjustments before saving.
6

Write output

The final YAML is validated with Zod and written to the output path.

Examples

Compose with CLI arguments

This creates a runbook that:
  1. Prompts the user for accountType
  2. If "personal" → runs the personal signup steps
  3. If "business" → runs the business signup steps

Interactive mode

The CLI will interactively ask for the branch variable, cases, and goal.

Output structure

The composed runbook contains a single step with branches:
See Loops & Branches for the branch schema.