Skip to main content
Workflow sessions track the execution history of your workflows. Unlike agent or team sessions that store conversation messages, workflow sessions store complete workflow runs, where each run represents a full execution of all your workflow steps from input to final output. Think of it this way:
  • Agent/Team sessions = conversation history (messages back and forth)
  • Workflow sessions = execution history (complete pipeline runs with results)

When to Use Workflow Sessions

Use workflow sessions when you need to:
  • Track workflow execution history across multiple runs
  • Share state between steps in a workflow (like passing data between pipeline stages)
  • Enable workflows to learn from previous runs by accessing past inputs and outputs
  • Persist workflow results for analysis and debugging
  • Maintain context across multiple workflow executions
In most cases it is recommended to add session persistence to your workflow.

How Workflow Sessions Work

When you create a workflow with a database, Agno automatically manages sessions for you:
Each time you run the workflow, Agno:
  1. Creates a unique run_id for this execution
  2. Stores the input, output, and all step results
  3. Updates the session with the new run
  4. Makes the history available for future runs

Workflow Session Structure

A workflow session stores:
Unlike agent sessions, workflow sessions don’t have a summary field. Workflows store complete run results instead of creating summaries.

What Gets Stored

Each workflow run stores:
  • Input: The data passed to workflow.run()
  • Output: The final result from the workflow
  • Step results: Output from each step in the pipeline
  • Session Data: Execution time, status, metrics
  • Session state: Shared data between steps (if used)

Key Differences from Agent/Team Sessions

If you’re familiar with agent or team sessions, here are the main differences:

Database Options

Workflow sessions require a database to persist execution history. Agno supports multiple database types:

Database Configuration Guide

See all supported databases, connection options, and production recommendations

Workflow History

Workflow history lets workflow steps access results from previous runs. When enabled, Agno formats prior run results and prepends them to each step input so future executions can build on that context.

Enable history for your steps

Why it helps:
  • Access previous runs instead of repeating work
  • Reference past decisions to keep outputs consistent
  • Maintain context across multi-run workflows
  • Build on prior results for richer analysis

History format

Agno wraps past runs in a structured XML block before inserting it into each step input:
See the workflow history implementation guide for advanced controls, per-step overrides, and programmatic access patterns.

Session Naming

Give your workflow sessions meaningful names for easier identification:

Manual Naming

Auto-Generation

Workflow sessions can auto-generate timestamp-based names:

Next Steps

Now that you understand workflow sessions, explore these features:

Workflow History

Enable workflows to learn from previous runs

Session State

Share data between workflow steps across runs

Session Management

Manage session names, IDs, and organization

Conversational Workflows

Make workflows interactive with WorkflowAgent

Metrics

Track workflow performance and usage

Database Setup

Configure databases for session storage

Developer Resources