Skip to main content
AgentFlow runs agents as sequential steps, passing each output into the next as context.

Quick Start

1

Sequential pipeline

2

Parallel research

3

Conditional routing


How It Works

Each step receives the previous step’s output as context. Context passing is automatic — no extra code required.

Which Pattern to Use?


Pattern Helpers


parallel() and max_workers

max_workers caps concurrent steps in parallel() and loop(parallel=True).

Workflow Hooks

WorkflowHooksConfig options:

Planning & Reasoning

Pass planning=True to enable it, or a dict to tune the planner:
Prefer the bool or dict form above. Use WorkflowPlanningConfig when you want typed, IDE-friendly configuration.

Memory Integration

Pass memory=True for the default file backend, or a dict to pick a backend:
Prefer the bool or dict form above. Use WorkflowMemoryConfig when you want typed, IDE-friendly configuration.

Guardrails & Validation


Output Modes


Async Execution


Status Tracking


Variable Substitution

Every action string processes placeholders in this order:
For YAML workflows loaded via YAMLWorkflowParser, the top-level input: field is stored as workflow.default_input and used automatically when start() / run() is called with no argument. See Workflow Input Resolution for the full precedence ladder.
{{today}}, {{now}}, and {{uuid}} are provided by the separate Dynamic Variables mechanism, not the workflow template engine.

WorkflowManager

WorkflowManager discovers and executes markdown-defined workflows from .praisonai/workflows/.
AgentFlow is the primary workflow surface. WorkflowManager is a secondary API for running markdown-defined workflows.

Checkpoints

Async


Workflow File Format

Markdown files with YAML frontmatter define multi-step workflows for WorkflowManager:
if_() is deprecated. Use when() instead for conditional steps. if_() will be removed in a future release.

Best Practices

Give each step a distinct agent with a focused role — Researcher, Analyst, Writer. Agents with clear instructions outperform generalist ones.
LLM-backed parallel steps hit rate limits fast. Start with max_workers=3 and increase only after testing.
Use Task(name="...") for every step. Named steps appear in workflow.step_statuses and execution history.
Add guardrails= to steps that produce structured output (reports, JSON, code). Short feedback loops via max_retries cost less than prompt engineering.
Use when(condition="{{score}} > 80", ...) for simple thresholds. Reserve route() for multi-branch decisions.
One step → one responsibility. Easier to debug, retry, and replace.

YAML Workflows

Define complex workflows in YAML files

Nested Workflows

Combine loops, parallel, and routing patterns

Hybrid Workflows

Mix deterministic shell steps with agent steps

Job Workflows

Ordered pipelines of shell commands and agent steps