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.

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"].

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