Skip to main content

YAML Workflow Configuration

Flo AI supports creating entire multi-agent workflows through YAML configuration files, making it easy to version control, share, and manage complex workflow configurations.

Basic YAML Workflow

Create a simple workflow using YAML:
workflow.yaml
Load YAML Workflow

Advanced YAML Configuration

Workflow with Function Nodes

Function nodes allow you to execute custom Python functions within workflows:
function-workflow.yaml

Workflow with Routers

Use routers for intelligent routing decisions:
router-workflow.yaml

Workflow with Nested Arium (Sub-workflows)

Create nested workflows for complex scenarios:
nested-workflow.yaml

Workflow with ForEach Nodes

Process items in batches using ForEach nodes:
foreach-workflow.yaml

Agent Configuration in Workflows

Agents in workflows support multiple configuration methods:

Method 1: Direct Configuration

Method 2: Reference Pre-built Agent

Method 3: Inline YAML Config

Method 4: External YAML File Reference

Router Types

Smart Router

Uses LLM to intelligently route based on content:

Task Classifier Router

Routes based on task categories:

Conversation Analysis Router

Routes based on conversation analysis:

Reflection Router

For A→B→A→C feedback patterns:

YAML Schema Reference

Metadata Section

Arium Configuration

Agent Configuration

Note: input_filter for agents specifies which nodes’ outputs should be passed as inputs to this agent. Only results from the specified node names will be included. If not specified, all available memory items are passed.

Function Node Configuration

Note: input_filter specifies which nodes’ outputs should be passed as inputs to this node. Only results from the specified node names will be included. If not specified, all available memory items are passed.

Router Configuration

Edge Configuration

Arium Node Configuration (Nested Workflows)

Note: input_filter for nested ariums works the same way - it filters which parent workflow nodes’ outputs are passed to the nested workflow.

ForEach Node Configuration

Note: input_filter for ForEach nodes filters which nodes’ outputs are used as the collection to iterate over.

Loading and Using YAML Workflows

Basic Loading

Loading with Registries

When using function nodes or tool-enabled agents, provide registries:

Loading with Pre-built Agents

Reference pre-built agents in YAML:

Loading with Custom Routers

Provide custom router functions:

Running Workflows

Writing/Saving YAML Workflow Configuration

To save a workflow configuration to YAML, you can manually construct the YAML structure:

Validation and Testing

Schema Validation

Use the AriumYamlModel for proper validation of YAML configurations:
You can also use AriumBuilder.from_yaml() which automatically validates the configuration:

Testing YAML Workflows

Best Practices

Workflow Structure

  1. Use meaningful names: Choose descriptive agent, node, and router names
  2. Version your configurations: Always include version numbers in metadata
  3. Document thoroughly: Add descriptions for all components
  4. Validate schemas: Use YAML schema validation tools

Performance Optimization

Security Considerations

Examples

Content Analysis Workflow

content-analysis.yaml

Multi-Agent Routing Workflow

routing-workflow.yaml

Reflection Workflow

reflection-workflow.yaml
This YAML-based approach makes workflow configuration declarative, versionable, and easily shareable across teams!