Orchestrate multi-stage agent pipelines with dependency management{project-root}/_bmad/core/pipeline/pipeline-config.yaml{project-root}/_bmad-output/pipelinesAsk user for pipeline source:
1. Use template (show available templates)
2. Define custom pipeline
List templates from config: full_sdlc, quick_flow, analysis_only, design_review, test_suiteUser selects templateCopy template stages to new pipeline definitionAsk for pipeline nameAsk for stages (agent, parallel, depends_on, outputs)Build pipeline definitionGenerate pipeline_id: "PIPE-{YYYYMMDD}-{name}"Create pipeline file: {pipeline_dir}/{pipeline_id}.yamlInitialize all stages as "pending"Load pipeline from {pipeline_id}.yamlValidate pipeline definition (agents exist, dependencies valid)Set pipeline status to "running"Initialize execution state trackingFind stages where:
- Status == "pending" AND
- All depends_on stages are "completed"
Mark found stages as "queued"Launch agents in parallel using Task tool with run_in_background=trueTrack agent_ids for each stageLaunch agent using Task tool with run_in_background=falseWait for completionFor parallel stages: Use TaskOutput to collect resultsUpdate stage status based on result (completed/failed)Store outputs in {pipeline_dir}/outputs/{stage_name}/Mark pipeline as "failed"Mark dependent stages as "skipped"HALT: "Pipeline failed at stage: {stage_name}"Mark dependent stages as "skipped"Continue with non-dependent stagesUpdate pipeline file with current stateMark pipeline as "completed"Load pipeline from {pipeline_id}.yaml (or active-pipeline.yaml)Calculate progress percentageScan {pipeline_dir} for pipeline filesLoad templates from configLoad running pipelineSend abort signal to running agentsMark running stages as "aborted"Mark pipeline as "aborted"Load failed/aborted pipelineIdentify failed/aborted stagesAsk user: Retry failed stages or skip?Reset failed stages to "pending"Continue with run logicMark failed stages as "skipped"Continue with remaining stages