Skip to main content
An output_variable names a task’s result so later tasks can read it.
Available under PraisonAIAgents / AgentTeam as of PraisonAI PR #4907. Earlier releases only exposed output_variable inside the standalone Workflow engine and its YAML syntax. PraisonAI #4932 fixed the parallel-branch case, where an output_variable set inside parallel([...]) was previously discarded.

Quick Start

1

Store one task's output

Name the result with output_variable.
2

Read it in the next task

Reference the stored value with {{research_data}} in a later task’s action.

How It Works

After any task completes — agent or handler — its raw output is stored under the given name in the team’s shared variables.

Reading Variables

Substitute a stored value directly in action or description with {{name}}.
Read the same value inside a handler or should_run with ctx.variables["name"].

Inside parallel blocks

An output_variable set inside a parallel([...]) branch is visible to every step after the block, keyed by that exact name.
If two branches use the same output_variable, the later-declared branch wins and a warning is logged — give them distinct names. See Named outputs from branches for the full merge rule.

Best Practices

Use clear names like research_data or score so downstream {{name}} references read naturally.
Attach output_variable to the task that creates the value, not the one that reads it.
Pass context=[producer_task] on the consumer so the team runs them in the right order.

Handler Tasks

Run Python code as a task step

Conditions

Gate tasks with should_run

Workflows

Chain agents into pipelines