Skip to main content
Markdown workflows branch on any step’s output — jump to a labelled step instead of running linearly.

Quick Start

1

Write a branching workflow

.praisonai/workflows/classify.md
2

Run it

When step1’s output contains success, execution jumps to handle_success and skips handle_failure.

How It Works

WorkflowManager evaluates each step’s branch_condition against that step’s output, then jumps to the first matching next step.

Configuration Options

Equivalent Python:

Common Patterns

Success/failure classifier — jump to a handler based on outcome:
Score-based fanout — route on a threshold match in the output:
No-op fallback — when nothing matches, execution continues linearly to the next step, so a missing branch never stalls the workflow.

Best Practices

Every value in a branch block must reference an existing ## step. Undefined targets are skipped.
Instruct the step to state the match keyword clearly (“Reply with success or failure”) so the branch matches reliably.
Use a single branch block per step for a clear one-to-many jump. Use next_steps frontmatter for the default path.

Conditional Execution

Task when / then_task / else_task syntax

YAML Workflows

Full YAML workflow reference

Workflow Routing

Python AgentFlow routing

Tasks

Task fields reference