The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/document-project/workflow.yaml Communicate all responses in {communication_language}
This router determines workflow mode and delegates to specialized sub-workflows
mode: data data_request: project_config
{{suggestion}} Note: Documentation workflow can run standalone. Continuing without progress tracking. Set standalone_mode = true Set status_file_found = false
Store {{status_file_path}} for later updates Set status_file_found = true
<output>Note: This is a greenfield project. Documentation workflow is typically for brownfield projects.</output>
<ask>Continue anyway to document planning artifacts? (y/n)</ask>
<check if="n">
<action>Exit workflow</action>
</check>
<param>mode: validate</param>
<param>calling_workflow: document-project</param>
<output>{{warning}}</output>
<output>Note: This may be auto-invoked by prd for brownfield documentation.</output>
<ask>Continue with documentation? (y/n)</ask>
<check if="n">
<output>{{suggestion}}</output>
<action>Exit workflow</action>
</check>
SMART LOADING STRATEGY: Check state file FIRST before loading any CSV files
Check for existing state file at: {output_folder}/project-scan-report.json
Read state file and extract: timestamps, mode, scan_level, current_step, completed_steps, project_classification Extract cached project_type_id(s) from state file if present Calculate age of state file (current time - last_updated)
I found an in-progress workflow state from {{last_updated}}.
Current Progress:
Would you like to:
Your choice [1/2/3]:
<action>Set resume_mode = true</action>
<action>Set workflow_mode = {{mode}}</action>
<action>Load findings summaries from state file</action>
<action>Load cached project_type_id(s) from state file</action>
<critical>CONDITIONAL CSV LOADING FOR RESUME:</critical>
<action>For each cached project_type_id, load ONLY the corresponding row from: {documentation_requirements_csv}</action>
<action>Skip loading project-types.csv and architecture_registry.csv (not needed on resume)</action>
<action>Store loaded doc requirements for use in remaining steps</action>
<action>Display: "Resuming {{workflow_mode}} from {{current_step}} with cached project type(s): {{cached_project_types}}"</action>
<check if="workflow_mode == deep_dive">
<action>Load and execute: {installed_path}/workflows/deep-dive-instructions.md with resume context</action>
</check>
<check if="workflow_mode == initial_scan OR workflow_mode == full_rescan">
<action>Load and execute: {installed_path}/workflows/full-scan-instructions.md with resume context</action>
</check>
<action>Create archive directory: {output_folder}/.archive/</action>
<action>Move old state file to: {output_folder}/.archive/project-scan-report-{{timestamp}}.json</action>
<action>Set resume_mode = false</action>
<action>Continue to Step 0.5</action>
<action>Display: "Exiting workflow without changes."</action>
<action>Exit workflow</action>
Check if {output_folder}/index.md exists
Read existing index.md to extract metadata (date, project structure, parts count) Store as {{existing_doc_date}}, {{existing_structure}}
I found existing documentation generated on {{existing_doc_date}}.
What would you like to do?
Your choice [1/2/3]:
<action>Set workflow_mode = "full_rescan"</action>
<action>Display: "Starting full project rescan..."</action>
<action>Load and execute: {installed_path}/workflows/full-scan-instructions.md</action>
<action>After sub-workflow completes, continue to Step 4</action>
<action>Set workflow_mode = "deep_dive"</action>
<action>Set scan_level = "exhaustive"</action>
<action>Display: "Starting deep-dive documentation mode..."</action>
<action>Load and execute: {installed_path}/workflows/deep-dive-instructions.md</action>
<action>After sub-workflow completes, continue to Step 4</action>
<action>Display message: "Keeping existing documentation. Exiting workflow."</action>
<action>Exit workflow</action>
Set workflow_mode = "initial_scan" Display: "No existing documentation found. Starting initial project scan..." Load and execute: {installed_path}/workflows/full-scan-instructions.md After sub-workflow completes, continue to Step 4
<param>mode: update</param>
<param>action: complete_workflow</param>
<param>workflow_name: document-project</param>
<output>Status updated!</output>
**✅ Document Project Workflow Complete, {user_name}!**
**Documentation Generated:**
- Mode: {{workflow_mode}}
- Scan Level: {{scan_level}}
- Output: {output_folder}/index.md and related files
{{#if status_file_found}}
**Status Updated:**
- Progress tracking updated
**Next Steps:**
- **Next required:** {{next_workflow}} ({{next_agent}} agent)
Check status anytime with: `workflow-status`
{{else}}
**Next Steps:**
Since no workflow is in progress:
- Refer to the BMM workflow guide if unsure what to do next
- Or run `workflow-init` to create a workflow path and get guided next steps
{{/if}}