Overview
Custom workflows allow you to orchestrate multiple agents through a sequence of steps, creating repeatable processes for complex operations.Workflow Concepts
Key Components
| Concept | Description |
|---|---|
| Workflow | A YAML definition orchestrating multiple agents |
| Phase | A logical grouping of related steps |
| Step | A single action performed by an agent |
| Transition | Movement from one step to the next with optional conditions |
| State | Persistent tracking of workflow progress across sessions |
Workflow Types
| Type | Description | Use Case |
|---|---|---|
| Greenfield | New projects from scratch | Starting new applications |
| Brownfield | Existing projects | Enhancing existing code |
| Generic | Any project type | Cross-cutting processes |
Creating a Workflow
Step 1: Plan Your Workflow
Define:- Purpose - What problem does this workflow solve?
- Agents - Which agents participate?
- Sequence - What is the order of steps?
- Conditions - Are there decision points or parallel activities?
Step 2: Use Create Workflow Task
Step 3: Answer Elicitation Questions
The task will ask:- Target Context:
core,squad, orhybrid - Workflow Name: e.g.,
feature-development - Primary Goal: What is the expected outcome?
- Stages/Phases: Main phases of the workflow
- Agent Orchestration: Which agents at each stage
- Resource Requirements: Templates, data files needed
Workflow Structure
Basic Template
- Scenario 1
- Scenario 2 when_not_to_use:
- Anti-pattern 1
- New features requiring full process
- Complex features spanning multiple agents
- Features needing formal validation when_not_to_use:
- Simple bug fixes
- Documentation-only changes
- Urgent hotfixes
Check Status
Continue to Next Step
Skip Optional Step
Abort Workflow
Workflow State
State is persisted in.aiox/{instance-id}-state.yaml:
Advanced Features
Conditional Steps
Parallel Steps
Loop Steps
Output Location
Workflows are saved based on context:- Core:
.aiox-core/development/workflows/{name}.yaml - Squad:
squads/{squad}/workflows/{name}.yaml - Hybrid:
squads/{squad}/workflows/{name}.yaml
Best Practices
Workflow Design
- Keep phases focused - Each phase should have a clear purpose
- Define clear handoffs - Document what each agent passes to the next
- Include optional steps - Allow flexibility for simple cases
- Add decision guidance - Help users know when to use/not use
Step Definition
- Single responsibility - Each step does one thing well
- Clear actions - Describe what the agent should do
- Document outputs - Specify what files/data are created
- Include notes - Provide detailed instructions
Error Handling
- Define failure paths - What happens when a step fails?
- Set timeouts - Prevent infinite loops
- Save state frequently - Allow recovery from errors
- Provide rollback - Undo steps if needed
Workflow Validation
Troubleshooting
Workflow not found
No active instance
Step not optional
State corruption
Examples
Bug Fix Workflow
Code Review Workflow
Next Steps
- Workflow Patterns - Learn common workflow patterns
- Agent Flows - Understand how agents collaborate
- Task Creation - Build tasks for your workflows
- Squad Workflows - Create workflows for your squads