Overview
Blueprints can have branching paths that let your AI agent choose different workflows based on the situation. You can also allow early completion when objectives are met before all phases are finished.When to use branching: Your workflow has decision points where different approaches make sense. For example, a simple data migration might follow one path, while a complex migration with transformations follows another.
Understanding Branching
How It Works
Instead of following a single linear path (Phase 0 → Phase 1 → Phase 2), your blueprint can offer choices:Setting Up Branches
In your blueprint YAML, use next_options to define multiple paths:Using Descriptive Phase Names
You’re not limited to numbers. Use descriptive names like advanced_0, cleanup, or validation:Merging Paths Back Together
Different branches can converge back to a common phase:Early Completion
When to Use
Sometimes your objectives are met before reaching the final phase. Early completion lets the blueprint finish successfully at any decision point. Common scenarios:- Analysis reveals the project is already complete
- Quick path achieves all required outcomes
- User decides remaining phases aren’t needed
Setting Up Early Completion
Add an END option to next_options:Ensuring Required Files Exist
Why This Matters
Before taking a specific path, you may need certain files to exist. For example, the advanced path might require a configuration file that the simple path doesn’t need.Path-Specific Requirements
Use requires_documents to validate files before allowing a path:What Happens If Files Are Missing
If the AI agent tries to choose a path but required files don’t exist, you’ll see a clear error message:Ensuring Complete Deliverables for Early Exit
When allowing early completion, ensure all deliverables are ready:Understanding the difference:
- exit_criteria: Files needed to complete the current phase (always required)
- requires_documents on a path: Additional files needed to take that specific path
Complete Example
Here’s a practical blueprint with branching and early completion:Automatic Progression
When Branching Isn’t Needed
If a phase doesn’t have next_options, the blueprint automatically continues to the next sequential phase:Numbered Phases
“0” → “1” → “2” → “3”
Named Sequences
“setup_0” → “setup_1” → “setup_2”
Frequently Asked Questions
How does the AI agent choose which path to take?
How does the AI agent choose which path to take?
The agent analyzes your project requirements, context, and the description field for each option. It evaluates which path best matches your needs and automatically selects it.
Can I influence which path is chosen?
Can I influence which path is chosen?
Yes, by providing clear requirements and context in your initial conversation. The agent will ask clarifying questions if the right path isn’t obvious.
What happens if required documents are missing?
What happens if required documents are missing?
The agent will automatically create the missing documents before proceeding. You’ll see what files are being created and why.
Can I switch paths mid-mission?
Can I switch paths mid-mission?
No, once a path is chosen, the mission follows that branch. However, branches can merge back together at later phases.
How do I know when early completion is available?
How do I know when early completion is available?
The agent will inform you when objectives are met and offer to complete early. You can also see END options in the blueprint definition.
Best Practices
Clear Path Descriptions
Write descriptive text explaining when each path should be chosen. Help the AI agent make the right decision.
Validate Early Exits
Always require key deliverables when allowing early completion to ensure work quality.
Keep Branches Meaningful
Create branches for genuinely different approaches, not minor variations.
Plan Merge Points
Design where branches rejoin to avoid duplicating later phases unnecessarily.
What You’ll See During Execution
When running a blueprint with branching:- At Decision Points: The agent explains which path it’s choosing and why
- During Path Execution: Clear indication of which branch you’re on
- At Merge Points: Confirmation when branches rejoin the main workflow
- Early Completion Options: The agent will propose early completion when appropriate and explain why all objectives are met

