Skip to main content
No imperative code, no manual orchestration. Just declare what you want.

Execution Modes

Sequential Execution

Agents with dependencies run sequentially:
Execution order: fetch process store (because each depends on the previous)

Parallel Execution

Agents without dependencies run in parallel:
Performance: 3x faster than sequential execution.

Conditional Execution

Simple Conditions

Skip agents based on boolean expressions:

Based on Previous Outputs

Cache-or-Generate Pattern

Error Handling

Fallback Pattern

Retry Logic

Complex Conditions

Multiple Conditions

Dynamic Routing

Loops and Iteration

Array Processing

Batch Processing

Performance Optimization

Minimize Dependencies

Early Termination

Skip expensive operations when possible:

Advanced Patterns

Fan-Out/Fan-In

Process multiple items in parallel, then aggregate:

Pipeline with Validation

Circuit Breaker

Best Practices

  1. Parallel by Default - Only add dependencies when necessary
  2. Condition Expensive Operations - Skip work when possible
  3. Handle Failures - Always have fallbacks
  4. Use Retry Logic - For transient failures
  5. Early Termination - Fast checks before slow operations
  6. Cache Strategically - Cache expensive results
  7. Test Flow Paths - Test all conditional branches
  8. Monitor Performance - Track execution times

Next Steps

State Management

Share data across agents

A/B Testing

Test multiple variants

Operations

Learn about operations

Playbooks

Real-world patterns