Single Step Workflow
A single-step workflow that runs continuously with access to workflow history.
Use the add_workflow_history_to_steps flag to add workflow history to all the steps in the workflow.
In this case we have a single step workflow with a single agent.
The agent has access to the workflow history and uses it to provide personalized educational support.
Each CLI input starts a new pipeline run in the same session. Steps receive the last three completed workflow input/final-output pairs by default, plus their current step input. This is a bounded window, not every intermediate message. A clarification question in a plain linear step does not pause the pipeline for a user reply.
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from agno.workflow.step import Step
from agno.workflow.workflow import Workflow
tutor_agent = Agent(
name="AI Tutor",
model=OpenAIResponses(id="gpt-5.2"),
instructions=[
"You are an expert tutor who provides personalized educational support.",
"You have access to our recent completed workflow history.",
"Build on previous discussions - don't repeat questions or information.",
"Reference what the student has told you earlier in our conversation.",
"Adapt your teaching style based on what you've learned about the student.",
"Be encouraging, patient, and supportive.",
"When asked about conversation history, provide a helpful summary.",
"Focus on helping the student understand concepts and improve their skills.",
],
)
tutor_workflow = Workflow(
name="Simple AI Tutor",
description="Single-step conversational tutoring with history awareness",
db=SqliteDb(db_file="tmp/simple_tutor_workflow.db"),
steps=[
Step(name="AI Tutoring", agent=tutor_agent),
],
add_workflow_history_to_steps=True, # This adds the workflow history
)
def demo_simple_tutoring_cli():
"""Demo simple single-step tutoring workflow"""
print("Simple AI Tutor Demo - Type 'exit' to quit")
print("Try asking about:")
print("- 'I'm struggling with calculus derivatives'")
print("- 'Can you help me with algebra?'")
print("-" * 60)
tutor_workflow.cli_app(
session_id="simple_tutor_demo",
user="Student",
stream=True,
show_step_details=True,
)
if __name__ == "__main__":
demo_simple_tutoring_cli()Usage
Create a Python file
Create 01_single_step_continuous_execution_workflow.py with the code above.
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno openai sqlalchemyExport your OpenAI API key
export OPENAI_API_KEY="your_openai_api_key_here"Run Workflow
python 01_single_step_continuous_execution_workflow.py