Overview
Routa workflows enable you to automate complex, multi-step agent processes using declarative YAML configuration. Workflows orchestrate multiple specialists in sequence or parallel, with conditional execution, retries, and output passing. Key features:- Declarative YAML - Define workflows as code
- Specialist orchestration - Chain multiple agents together
- Parallel execution - Run steps concurrently
- Conditional steps - Execute based on previous outputs
- Variable substitution - Reference environment variables and step outputs
- Retry logic - Handle transient failures automatically
- Multiple triggers - Manual, webhook, or scheduled execution
Workflow Definition
Workflows are defined in YAML files with the following structure:workflow.yaml
Workflow Schema
Top-Level Fields
Trigger Configuration
Workflow Steps
Step Configuration
Variable Substitution
Workflows support${VAR} syntax for variable substitution:
- Workflow
variablesmap - Step outputs (via
output_key) - Environment variables
- Literal string (if no match)
Step Outputs
Steps can produce outputs that are referenced by downstream steps:- Stored in
WorkflowRun.stepOutputsmap - Keyed by
output_keyor stepname - Available to all subsequent steps
Conditional Execution
Steps can be conditionally executed based on previous outputs:- Simple string comparison
- Check for null/existence:
${var} != null - Equality:
${var} == 'value' - Inequality:
${var} != 'value'
Parallel Execution
Steps in the sameparallel_group run concurrently:
- Steps without
parallel_grouprun sequentially - Steps in a
parallel_grouprun concurrently - Next sequential step waits for all parallel steps to complete
Error Handling
Control what happens when a step fails:- stop (default) - Stop workflow execution, mark as FAILED
- continue - Log error, continue to next step
- retry - Retry up to
max_retriestimes, then stop if still failing
Workflow Examples
Example 1: PR Review Workflow
pr-review.yaml
Example 2: Deployment Workflow
deploy.yaml
Example 3: Scheduled Maintenance
maintenance.yaml
Example 4: Multi-Repo Analysis
analyze-repos.yaml
Running Workflows
Via REST API
Create Workflow
Trigger Workflow Run
Get Workflow Run Status
List Workflow Runs
Cancel Workflow Run
Via CLI
Workflow Storage
Workflows and runs are stored in the database:Monitoring and Debugging
View Run Logs
Debug Failed Runs
Best Practices
Keep steps focused
Keep steps focused
Each step should do one thing well:
Use parallel groups for independent tasks
Use parallel groups for independent tasks
Set appropriate timeouts
Set appropriate timeouts
Use output keys for dependencies
Use output keys for dependencies
Handle failures gracefully
Handle failures gracefully
Troubleshooting
Workflow fails to start
Workflow fails to start
- Check YAML syntax:
yamllint workflow.yaml - Verify all specialists exist
- Ensure variables are defined
Step timeout
Step timeout
- Increase
timeout_secsfor the step - Check if agent is stuck waiting for user input
- Review agent conversation logs
Variable not substituted
Variable not substituted
- Verify variable is defined in
variablesor environment - Check syntax:
${VAR}not$VAR - Ensure step output key matches reference
Parallel steps not running concurrently
Parallel steps not running concurrently
- Verify all steps have the same
parallel_groupvalue - Check if previous sequential step completed
- Review workflow execution logs
Conditional step not executing
Conditional step not executing
- Check condition syntax
- Verify referenced output key exists
- Review step outputs:
GET /api/workflows/runs/<run-id>/outputs
Next Steps
Custom Specialists
Create specialists for workflow steps
Custom MCP Servers
Give workflows access to external tools
GitHub Integration
Trigger workflows from GitHub events
Desktop App
Run workflows in desktop environment