Skip to main content
PraisonAI provides four powerful workflow patterns that can be combined to create complex, production-ready workflows.
The user picks a pattern; AgentFlow wires sequential, parallel, or routed steps accordingly.
The user describes a goal; the workflow runs the composed pattern end to end.

Quick Comparison

Import

AgentFlow is the primary class for deterministic pipelines (v1.0+). Workflow and Pipeline are silent aliases kept for backward compatibility — new code should use AgentFlow.

Quick Start

1

Import workflow helpers

2

Combine patterns in one workflow

How It Works

Pattern Overview

1. Routing (Decision Branching)

Route to different steps based on previous output:
📖 Full Documentation →

2. Parallel (Concurrent Execution)

Execute multiple steps at the same time:
📖 Full Documentation →

3. Loop (Iterate Over Data)

Process each item in a list or file:
📖 Full Documentation →

4. Repeat (Evaluator-Optimizer)

Repeat until a condition is met:
📖 Full Documentation →

Combining Patterns

Patterns can be combined for complex workflows:

Common Workflow Architectures

Orchestrator-Worker

Fan-Out/Fan-In

Batch Processing Pipeline

Self-Improving Agent

Pattern Selection Guide

Pattern Tips

1. Start Simple

2. Handle Errors

3. Use Verbose Mode

4. Track State with Variables

API Reference

Best Practices

Combine route, parallel, loop, and repeat in readable sequences — avoid deeply nested workflow trees.
Use ctx.variables for counts and flags instead of global Python state.
Step-by-step progress output helps validate routing and loop behaviour before production.
Unexpected classifier output should fall back to a safe path, not fail silently.

See Also

Workflow Routing

Decision-based branching

Parallel Execution

Concurrent step execution

Loop Processing

Iterate over data

Repeat Pattern

Evaluator-optimizer pattern

Workflow Input Resolution

How the value passed to start(...) and {{input}} is resolved