> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Streaming Workflow

> Research + Write workflow with live step progress on Telegram.

## Code

```python streaming_workflow.py theme={null}
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIChat
from agno.os.app import AgentOS
from agno.os.interfaces.telegram import Telegram
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.workflow.step import Step
from agno.workflow.steps import Steps
from agno.workflow.workflow import Workflow

db = SqliteDb(
    session_table="telegram_streaming_wf_sessions",
    db_file="tmp/telegram_streaming_workflow.db",
)

researcher = Agent(
    name="Researcher",
    model=OpenAIChat(id="gpt-4o-mini"),
    tools=[DuckDuckGoTools()],
    instructions=[
        "Research the topic using web search.",
        "Provide bullet-point findings with sources.",
    ],
)

writer = Agent(
    name="Writer",
    model=OpenAIChat(id="gpt-4o-mini"),
    instructions=[
        "Write a clear, concise summary from the research.",
        "Use **bold** for key terms and keep it under 300 words.",
        "Suitable for reading on a phone screen.",
    ],
)

research_write_workflow = Workflow(
    name="Research and Write",
    description="Two-step workflow: research a topic, then write a polished summary",
    steps=[
        Steps(
            name="research_and_write",
            description="Research then write",
            steps=[
                Step(
                    name="research", agent=researcher, description="Research the topic"
                ),
                Step(name="write", agent=writer, description="Write the summary"),
            ],
        )
    ],
    db=db,
)

agent_os = AgentOS(
    workflows=[research_write_workflow],
    interfaces=[
        Telegram(
            workflow=research_write_workflow,
            reply_to_mentions_only=False,
            streaming=True,
            start_message="Research bot ready. Send me a topic and I will research and summarize it.",
        )
    ],
)
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="streaming_workflow:app", reload=True)
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set Environment Variables">
    ```bash theme={null}
    export TELEGRAM_TOKEN=your-bot-token-from-botfather
    export OPENAI_API_KEY=your-openai-api-key
    export APP_ENV=development
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[os,telegram]" openai ddgs
    ```
  </Step>

  <Step title="Run Example">
    ```bash theme={null}
    python streaming_workflow.py
    ```

    The bot needs a public webhook URL to receive messages. See [Telegram setup](/agent-os/interfaces/telegram/setup).
  </Step>
</Steps>

## Key Features

* **Live Step Progress**: Users see which step is running in real time (e.g., "research...", then "research" when the step completes)
* **Web Search**: Researcher agent uses DuckDuckGo to find current information
* **Final Summary**: The Writer's output arrives as a single message when the workflow completes; the live message edits are the step status lines
* **Custom Start Message**: Overrides the default `/start` response
