Skip to main content
Workflow History enables your Agno workflows to remember and reference previous conversations, transforming isolated executions into continuous, context-aware interactions. Instead of starting fresh each time, with Workflow History you can:
  • Build on previous interactions - Reference the context of past interactions
  • Avoid repetitive questions - Avoid requesting previously provided information
  • Maintain context continuity - Create a conversational experience
  • Learn from patterns - Analyze historical data to make better decisions
Note that this feature is different from add_history_to_context. This does not add the history of a particular agent or team, but the full workflow history to either all or some steps.

How It Works

When workflow history is enabled, previous messages are automatically injected into agent/team inputs as structured context:
Along with this, in using Steps with custom functions, you can access this history in the following ways:
  1. As a formatted context string as shown above
  2. In a structured format as well for more control
A database is required to use Workflow history. Runs across different executions will be persisted there.
Example-
You can use these helper functions to access the history:
  • step_input.get_workflow_history(num_runs=3)
  • step_input.get_workflow_history_context(num_runs=3)
Refer to StepInput reference for more details.

Control Levels

You can be specific about which Steps to add the history to:

Workflow-Level History

Add workflow history to all steps in the workflow:

Step-Level History

Add workflow history to specific steps only:
You can also put add_workflow_history=False to disable history for a specific step.

Precedence Logic

Step-level settings always take precedence over workflow-level settings:

History Length Control

By default, all available history is included (no limit). It is recommended to use a fixed history run limit to avoid bloating the LLM context window. You can control this at both levels:

Developer Resources

Single Step Continuous Execution

Single step workflow with continuous execution and history awareness.

Workflow History for Steps

Add workflow history to all steps in the workflow.

Enable History for Specific Step

Enable workflow history for a specific step only.

Get History in Function

Access workflow history in custom functions for analysis.