Remote Team and Workflow
RemoteTeam and RemoteWorkflow use the native AgentOS protocol while returning typed Agno Team and Workflow outputs to the caller.
"""
Run a Team and Workflow on another AgentOS
==========================================
RemoteTeam and RemoteWorkflow use the native AgentOS protocol while returning
typed Agno Team and Workflow outputs to the caller.
Prerequisites: start `servers/agentos_server.py` and set OPENAI_API_KEY
Run: .venvs/demo/bin/python cookbook/05_agent_os/20_remote/02_remote_team_and_workflow.py
Try: ask the Team for a conceptual answer and the Workflow for arithmetic
"""
import asyncio
from agno.team import RemoteTeam
from agno.workflow import RemoteWorkflow
BASE_URL = "http://127.0.0.1:7780"
# ---------------------------------------------------------------------------
# Create Remote Team and Workflow
# ---------------------------------------------------------------------------
remote_team = RemoteTeam(
base_url=BASE_URL,
team_id="research-team",
)
remote_workflow = RemoteWorkflow(
base_url=BASE_URL,
workflow_id="qa-workflow",
)
# ---------------------------------------------------------------------------
# Run Remote Team and Workflow
# ---------------------------------------------------------------------------
async def run_remote_components() -> None:
"""Run both native AgentOS component types."""
team_response = await remote_team.arun(
"In two bullets, explain how an Agent differs from a Workflow.",
session_id="remote-team-session",
)
print(f"Team run: {team_response.run_id}")
print(team_response.content)
workflow_response = await remote_workflow.arun(
"Use the calculator to divide 144 by 12.",
session_id="remote-workflow-session",
)
print(f"\nWorkflow run: {workflow_response.run_id}")
print(workflow_response.content)
if __name__ == "__main__":
asyncio.run(run_remote_components())Run the Example
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateInstall dependencies
uv pip install -U agno fastapiStart the required upstream servers
Follow each linked server guide in its own terminal, installing its dependencies and setting its provider key there. Keep those processes running while this example executes.
| Server setup | Port |
|---|---|
| Native AgentOS | 7780 |
Use the native server's default local setup with OS_SECURITY_KEY unset.
Run the example
Save the code above as remote_team_and_workflow.py, then run:
python remote_team_and_workflow.pyFull source: cookbook/05_agent_os/20_remote/02_remote_team_and_workflow.py