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
planning=True to enable it, or a dict to tune the planner:
Advanced: WorkflowPlanningConfig class
Advanced: WorkflowPlanningConfig class
Prefer the
bool or dict form above. Use WorkflowPlanningConfig when you want typed, IDE-friendly configuration.Memory Integration
memory=True for the default file backend, or a dict to pick a backend:
Advanced: WorkflowMemoryConfig class
Advanced: WorkflowMemoryConfig class
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
Everyaction 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 forWorkflowManager:
Best Practices
Use specialized agents per step
Use specialized agents per step
Give each step a distinct agent with a focused role — Researcher, Analyst, Writer. Agents with clear instructions outperform generalist ones.
Set max_workers for parallel steps
Set max_workers for parallel steps
LLM-backed parallel steps hit rate limits fast. Start with
max_workers=3 and increase only after testing.Name your steps for debugging
Name your steps for debugging
Use
Task(name="...") for every step. Named steps appear in workflow.step_statuses and execution history.Guardrails over hope
Guardrails over hope
Add
guardrails= to steps that produce structured output (reports, JSON, code). Short feedback loops via max_retries cost less than prompt engineering.Prefer when() over complex routing
Prefer when() over complex routing
Use
when(condition="{{score}} > 80", ...) for simple thresholds. Reserve route() for multi-branch decisions.Keep steps atomic
Keep steps atomic
One step → one responsibility. Easier to debug, retry, and replace.
Related
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

