Skip to main content

Agent Workflows

AgentFlow is now the primary class name (v1.5.5+). Workflow and Pipeline are silent aliases. See AgentFlow for the latest documentation.
Workflows let you orchestrate multiple Agents in complex pipelines. Chain Agents sequentially, run them in parallel, or route to different Agents based on conditions.

Quick Start

1

Simple Usage

2

With Configuration

See the sections below for advanced options.

Sequential Agent Pipeline

Parallel Agent Execution

Run multiple Agents simultaneously:

Agent Router Workflow

Route to different Agents based on conditions:

Agent Loop (Iterative Refinement)

Have an Agent iterate until satisfied:

Multi-Agent Workflow with Context

Share context between Agents in a workflow:

Conditional Agent Steps

Skip Agents based on conditions:

Agent Workflow with Error Handling

Handle Agent failures gracefully:

Workflow Patterns

Multi-Agent

Multi-Agent

Guardrails

Guardrails