Skip to content
🤖 AI-optimized docs: llms-full.txt

Workflow Schema Reference

Complete reference for workflow file structure, frontmatter, step types, menu patterns, and validation rules.

my-workflow/
├── workflow.md # Entry point and configuration
├── steps-c/ # Create flow steps
│ ├── step-01-init.md
│ ├── step-02-process.md
│ └── step-N-complete.md
├── steps-e/ # Edit flow (optional)
├── steps-v/ # Validate flow (optional)
├── data/ # Reference materials
└── templates/ # Output templates

The workflow.md file contains workflow configuration in YAML frontmatter.

---
name: my-workflow
description: A brief description of what this workflow does
web_bundle: true
---
FieldTypeDescription
namestringWorkflow identifier (kebab-case)
descriptionstringShort description
web_bundlebooleanInclude in web bundle builds
---
createWorkflow: './steps-c/step-01-init.md'
conversionWorkflow: './steps-c/step-00-conversion.md'
---

Each step is a separate markdown file loaded only when needed.

---
name: 'step-01-init'
description: 'Initialize the workflow'
nextStepFile: './step-02-process.md'
outputFile: '{output_folder}/output.md'
---
FieldTypeRequiredDescription
namestringYesStep identifier (kebab-case)
descriptionstringYesWhat this step does
nextStepFilestringNoPath to next step
outputFilestringNoOutput document path
MetricValue
RecommendedUnder 200 lines
Absolute Maximum250 lines

If exceeded, split into multiple steps or extract to /data/ files.

Step TypeUse CaseMenu Pattern
Init (non-continuable)Single-session workflow startAuto-proceed
Init (continuable)Multi-session workflow startContinuation detection
Continuation (01b)Paired with continuable initRoutes to next step
Middle (standard)Collaborative contentA/P/C menu
Middle (simple)Data gatheringC only
BranchUser choice determines pathCustom letters
Validation sequenceMultiple checksAuto-proceed
Final polishOptimize documentNone (final)
FinalCompletionNone (final)

Available to all workflows:

VariableExampleDescription
{project-root}/Users/user/dev/projectProject root directory
{project_name}my-projectProject name
{output_folder}/Users/user/dev/project/outputConfigured output folder
{user_name}BrianUser name
{communication_language}englishCommunication language
{document_output_language}englishDocument output language

Available to workflows in a module (defined in module.yaml):

VariableExampleModule
{bmb_creations_output_folder}{project-root}/_bmad/bmb-creationsBMB
{planning_artifacts}{project-root}/_bmad/bmm/planning-artifactsBMM
TypeFormatExample
Step to Step (same folder)./filename.md./step-02-vision.md
Step to Template (parent)../filename.md../template.md
Step to Subfolder./subfolder/file.md./data/config.csv
External References{project-root}/...{project-root}/_bmad/core/...
Output Files{folder_variable}/...{output_folder}/output.md

Every menu must have three sections: Display, Handler, and Execution Rules.

### N. Present MENU OPTIONS
Display: "**Select:** [A] [action] [P] [action] [C] Continue"
#### Menu Handling Logic:
- IF A: Execute {advancedElicitationTask}, then redisplay menu
- IF P: Execute {partyModeWorkflow}, then redisplay menu
- IF C: Save content to {outputFile}, update frontmatter, then load {nextStepFile}
- IF Any other: help user, then redisplay menu
#### EXECUTION RULES:
- ALWAYS halt and wait for user input after presenting menu
- ONLY proceed to next step when user selects 'C'
- After other menu items execution, return to this menu
LetterPurposeAfter Execution
AAdvanced ElicitationRedisplay menu
PParty ModeRedisplay menu
CContinue/AcceptSave and load next step
XExit/CancelEnd workflow
PatternUse CaseOptions
Standard A/P/CCollaborative contentAdvanced, Party, Continue
C OnlyData gathering, init stepsContinue only
BranchingUser choice determines pathCustom letters (L/R/F)
Auto-proceedInit, validationNo menu

Continuable workflows track progress in output file frontmatter:

---
stepsCompleted: ['step-01-init', 'step-02-process', 'step-03-design']
lastStep: 'step-03-design'
lastContinued: '2025-01-15'
status: IN_PROGRESS
---
FieldTypeDescription
stepsCompletedarrayList of completed step names
lastStepstringMost recent completed step
lastContinueddateLast continuation date
statusstringIN_PROGRESS or COMPLETE
Step 1 (init) → Creates plan.md from template
Step 2 (gather) → Appends requirements to plan.md
Step 3 (design) → Appends design decisions to plan.md
Step 4 (review) → Appends review/approval to plan.md
Step 5 (build) → READS plan.md, CREATES final artifacts
Step 1 (init) → Creates final-doc.md from minimal template
Step 2 (section) → Appends Section 1
Step 3 (section) → Appends Section 2
Step 4 (section) → Appends Section 3
Step 5 (polish) → Optimizes entire document
TypeDescriptionUse Case
Free-formMinimal template, progressive appendMost workflows (recommended)
StructuredSingle template with placeholdersConsistent formatting needed
Semi-structuredCore required sections + optional additionsFlexible but organized
StrictMultiple templates, exact definitionsCompliance, regulated industries
{{variable}} # Handlebars style (preferred)
[variable] # Bracket style (also supported)

Keep templates lean — structure only, not content.

When validating workflows, check:

  • Frontmatter contains required fields
  • name is valid kebab-case
  • All frontmatter variables are used in step body
  • Step files exist and are numbered sequentially
  • nextStepFile references are valid
  • Menus are properly formatted (display, handler, execution rules)
  • Continuable workflows have state tracking
  • Steps are under 250 lines
  • Handler section follows menu display
  • “Halt and wait” in execution rules
  • A/P options appropriate for step type
ViolationFix
Unused variable in frontmatterRemove unused variables
Hardcoded file pathUse {variable} format
A/P menu in step 1Remove A/P (inappropriate for init)
Missing handler sectionAdd handler after menu display
No “halt and wait” instructionAdd to EXECUTION RULES
Hardcoded stepsCompleted arrayAppend: “update stepsCompleted to add this step”
File exceeds 250 linesSplit into multiple steps or extract to /data/
PracticeWhy
One goal per stepKeeps steps focused and manageable
Number sequentiallyClear execution order
Load data files as neededJust-in-time loading
Update state after each stepProgress tracking for continuable workflows
Use menus for user choiceInteractive workflows need user input
Use A/P options appropriatelyNot every step needs alternatives
Extract large steps to dataKeeps step files focused
ResourceDescription
Builder CommandsWorkflow commands
Workflow VariablesComplete variable reference
Create Your First WorkflowWorkflow creation tutorial
What Are WorkflowsWorkflow concepts