Skip to main content

Overview

Custom workflows allow you to orchestrate multiple agents through a sequence of steps, creating repeatable processes for complex operations.

Workflow Concepts

Key Components

Workflow Types

Creating a Workflow

Step 1: Plan Your Workflow

Define:
  1. Purpose - What problem does this workflow solve?
  2. Agents - Which agents participate?
  3. Sequence - What is the order of steps?
  4. Conditions - Are there decision points or parallel activities?

Step 2: Use Create Workflow Task

Step 3: Answer Elicitation Questions

The task will ask:
  1. Target Context: core, squad, or hybrid
  2. Workflow Name: e.g., feature-development
  3. Primary Goal: What is the expected outcome?
  4. Stages/Phases: Main phases of the workflow
  5. Agent Orchestration: Which agents at each stage
  6. Resource Requirements: Templates, data files needed

Workflow Structure

Basic Template

decision_guidance: when_to_use:
  • Scenario 1
  • Scenario 2 when_not_to_use:
  • Anti-pattern 1
handoff_prompts: step1_complete: “Step 1 done. Next: @agent for step 2”
decision_guidance: when_to_use:
  • 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
handoff_prompts: prd_complete: “PRD complete. Next: @po validate PRD” validate_complete: “PRD validated. Next: @sm create story” story_complete: “Story created. Next: @po validate story” validate_story_complete: “Story validated. Next: @dev implement” dev_complete: “Implementation complete. Next: @qa review” qa_complete: “QA passed. Next: @devops push” push_complete: “Changes pushed. Next: @po close story”

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

  1. Keep phases focused - Each phase should have a clear purpose
  2. Define clear handoffs - Document what each agent passes to the next
  3. Include optional steps - Allow flexibility for simple cases
  4. Add decision guidance - Help users know when to use/not use

Step Definition

  1. Single responsibility - Each step does one thing well
  2. Clear actions - Describe what the agent should do
  3. Document outputs - Specify what files/data are created
  4. Include notes - Provide detailed instructions

Error Handling

  1. Define failure paths - What happens when a step fails?
  2. Set timeouts - Prevent infinite loops
  3. Save state frequently - Allow recovery from errors
  4. 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