RemoteWorkflow allows you to run workflows that are hosted on a remote AgentOS instance. It provides the same interface as a local workflow, making it easy to integrate remote workflows into your applications.
Installation
Basic Usage
Parameters
| Parameter | Type | Default | Description |
|---|
base_url | str | Required | Base URL of the remote AgentOS instance (e.g., "http://localhost:7777") |
workflow_id | str | Required | ID of the remote workflow to execute |
timeout | float | 300.0 | Request timeout in seconds |
config_ttl | float | 300.0 | Time-to-live for cached configuration in seconds |
Properties
Returns the workflow ID.
name
Returns the workflow’s name from the remote configuration.
description
Returns the workflow’s description from the remote configuration.
Returns a RemoteDb instance if the workflow has a database configured.
Methods
arun
Execute the remote workflow asynchronously.
Parameters:
| Parameter | Type | Default | Description |
|---|
input | str | Dict | List | BaseModel | Required | The input for the workflow |
additional_data | Optional[Dict] | None | Additional data to pass to the workflow |
user_id | Optional[str] | None | User ID for the run |
run_id | Optional[str] | None | Custom run ID |
session_id | Optional[str] | None | Session ID for context persistence |
session_state | Optional[Dict] | None | Session state dictionary |
images | Optional[List[Image]] | None | Images to include |
audio | Optional[List[Audio]] | None | Audio to include |
videos | Optional[List[Video]] | None | Videos to include |
files | Optional[List[File]] | None | Files to include |
stream | bool | False | Whether to stream the response |
stream_events | Optional[bool] | None | Whether to stream events |
auth_token | Optional[str] | None | JWT token for authentication |
Returns:
WorkflowRunOutput when stream=False
AsyncIterator[WorkflowRunOutputEvent] when stream=True
cancel_run
Cancel a running workflow execution.
Parameters:
| Parameter | Type | Default | Description |
|---|
run_id | str | Required | ID of the run to cancel |
auth_token | Optional[str] | None | JWT token for authentication |
Returns: bool - True if successfully cancelled
get_workflow_config
Get the workflow configuration from the remote server (always fetches fresh).
Returns: WorkflowResponse
refresh_config
Force refresh the cached workflow configuration.
Returns: WorkflowResponse
A2A Protocol Support
RemoteWorkflow can connect to any A2A-compatible server using the protocol="a2a" parameter:
Connecting to Agno A2A Servers
Protocol Options
| Protocol | a2a_protocol | Use Case |
|---|
"agentos" | N/A | Default. Connect to Agno AgentOS REST API |
"a2a" | "rest" | Connect to A2A servers using REST endpoints |
"a2a" | "json-rpc" | Connect to Google ADK or pure JSON-RPC A2A servers |
Using in AgentOS Gateway
Remote workflows can be registered in a local AgentOS to create a gateway:
See AgentOS Gateway for more details.
Streaming Example
Error Handling
Authentication
For authenticated AgentOS instances, pass the auth_token parameter:
Notes
Remote Workflows via WebSocket are not yet supported. Use HTTP streaming instead.