Overview
Workflows enable complex, multi-step automation by orchestrating multiple agent invocations as a directed acyclic graph (DAG). Each step runs an agent with a specific profile and prompt, with support for dependency management, parallel execution, and output templating.Architecture
Workflows are defined as JSON files stored inworkspace/workflows/ and consist of:
- Metadata — Name and description
- Steps — Individual agent invocations with dependencies
- Execution layers — Parallel batches computed from the dependency graph
JSON Format
Step Definition
Each step supports the following fields:Field Validation Rules
Field Validation Rules
- name: Must match
^[\w-]+$(alphanumeric, underscore, hyphen only) - prompt: Cannot be empty or whitespace-only
- profile: Must exist in
config.agents.profiles - depends_on: All referenced steps must exist in the workflow
- timeout_seconds: Must be >= 1
Dependency Resolution
The engine computes execution layers using topological sort:Parallel Execution
Steps within the same layer execute concurrently viaasyncio.gather:
Parallel execution significantly reduces total workflow duration when steps have no interdependencies.
Template Syntax
Step prompts can reference outputs from previous steps using{{step_name.output}} syntax:
- Outputs are truncated to 50,000 characters to prevent context overflow
- Nested template references are stripped to prevent injection attacks
- Output is wrapped in clear delimiters for LLM parsing
Error Handling
Validation Errors
Validation Errors
Validation occurs before execution:
Runtime Failures
Runtime Failures
When a step fails, dependent steps are automatically skipped:Possible step statuses:
PENDING— Waiting to executeRUNNING— Currently executingCOMPLETED— Successfully finishedFAILED— Encountered an error or timeoutSKIPPED— Skipped due to dependency failure
Workflow Results
Execution produces a comprehensive result object:Persistence
Workflows are stored as JSON files inworkspace/workflows/:
CLI Usage
Related Features
- Task Tracking — Persistent todo lists for multi-step work
- Scheduling — Automated periodic workflow execution
- Skills — Specialized agent profiles for workflow steps