{"id":6292,"library":"uipath-runtime","title":"UiPath Runtime Python SDK","description":"uipath-runtime provides foundational interfaces and base contracts for building agent runtimes in the UiPath ecosystem. It defines the protocols that all runtime implementations must follow, offering utilities for execution context, event streaming, tracing, structured error handling, durable execution, and human-in-the-loop interactions. This package, currently at version 0.10.0, is under rapid development, with minor version changes indicating potential breaking changes to public interfaces.","status":"active","version":"0.10.0","language":"en","source_language":"en","source_url":"https://github.com/UiPath/uipath-runtime-python","tags":["uipath","rpa","automation","sdk","runtime","agent","ai","enterprise"],"install":[{"cmd":"pip install uipath-runtime","lang":"bash","label":"Install latest stable version"}],"dependencies":[{"reason":"Required for the SDK to run. Minimum version 3.11 is specified.","package":"python","optional":false}],"imports":[{"symbol":"UiPathRuntimeProtocol","correct":"from uipath.runtime import UiPathRuntimeProtocol"},{"symbol":"UiPathRuntimeResult","correct":"from uipath.runtime import UiPathRuntimeResult"},{"symbol":"UiPathRuntimeSchema","correct":"from uipath.runtime import UiPathRuntimeSchema"},{"symbol":"UiPathExecuteOptions","correct":"from uipath.runtime import UiPathExecuteOptions"},{"symbol":"UiPathRuntimeEvent","correct":"from uipath.runtime.events import UiPathRuntimeEvent"}],"quickstart":{"code":"from typing import Any, AsyncGenerator, Optional\nfrom uipath.runtime import (\n    UiPathRuntimeResult,\n    UiPathRuntimeStatus,\n    UiPathRuntimeSchema,\n    UiPathRuntimeEvent,\n    UiPathExecuteOptions,\n    UiPathStreamOptions,\n    UiPathRuntimeProtocol\n)\n\nclass MyRuntime(UiPathRuntimeProtocol):\n    \"\"\"Example runtime implementing the UiPath runtime protocols.\"\"\"\n\n    async def get_schema(self) -> UiPathRuntimeSchema:\n        return UiPathRuntimeSchema(\n            name=\"MyRuntime\",\n            description=\"A sample UiPath runtime\",\n            input_schema={'type': 'object', 'properties': {'name': {'type': 'string'}}},\n            output_schema={'type': 'object', 'properties': {'message': {'type': 'string'}}},\n        )\n\n    async def execute(\n        self, input: Any, options: Optional[UiPathExecuteOptions] = None\n    ) -> UiPathRuntimeResult:\n        name = input.get('name', 'World')\n        message = f\"Hello, {name}!\"\n        return UiPathRuntimeResult(status=UiPathRuntimeStatus.SUCCESS, output={'message': message})\n\n    async def stream(\n        self, input: Any, options: Optional[UiPathStreamOptions] = None\n    ) -> AsyncGenerator[UiPathRuntimeEvent, None]:\n        yield UiPathRuntimeEvent(name='start', payload={'input': input})\n        await self.execute(input, options) # Simulate execution\n        yield UiPathRuntimeEvent(name='end', payload={'result': 'success'})\n\n    async def dispose(self) -> None:\n        # Clean up resources if any\n        pass\n\n# To use this runtime (e.g., in a higher-level SDK or framework):\n# runtime_instance = MyRuntime()\n# schema = await runtime_instance.get_schema()\n# print(schema.model_dump_json(indent=2))\n# result = await runtime_instance.execute({'name': 'Alice'})\n# print(result.model_dump_json(indent=2))","lang":"python","description":"This quickstart demonstrates how to create a basic custom runtime by implementing the `UiPathRuntimeProtocol`. This protocol defines essential methods like `get_schema`, `execute`, `stream`, and `dispose` that all custom UiPath runtimes should follow."},"warnings":[{"fix":"Consult the `uipath-runtime-python` GitHub repository tags and any available release notes for detailed migration guides. Adjust code to new method signatures or interface changes.","message":"Minor version increments for `uipath-runtime` indicate breaking changes for public interfaces not explicitly marked as beta. Always review release notes when upgrading between minor versions (e.g., from 0.x to 0.y).","severity":"breaking","affected_versions":"All minor versions (e.g., 0.3.0 to 0.4.0, 0.9.0 to 0.10.0)"},{"fix":"Update imports and method calls to reflect the new names and signatures: `from uipath.runtime import UiPathDebugProtocol` and include `runtime_id` when calling `UiPathResumableStorageProtocol` methods. Adjust logic for `UiPathResumableRuntime` if using persistent storage.","message":"In version `0.3.0`, `UiPathDebugBridgeProtocol` was renamed to `UiPathDebugProtocol`. Methods on `UiPathResumableStorageProtocol` gained a `runtime_id` parameter, and `UiPathResumableRuntime` gained the ability to store arbitrary `(namespace, key, value)` tuples.","severity":"breaking","affected_versions":"<0.3.0"},{"fix":"Ensure you are using the correct package for your use case. If developing custom Python runtimes, focus on `uipath-runtime`. If integrating Python scripts into UiPath Studio workflows, refer to the documentation for `UiPath.Python.Activities`.","message":"This `uipath-runtime` Python package is distinct from `UiPath.Python.Activities` used within UiPath Studio. While related, `uipath-runtime` focuses on programmatic creation of UiPath runtimes in Python, whereas `UiPath.Python.Activities` facilitates running Python scripts *within* UiPath Studio workflows. The latter may have additional .NET Desktop Runtime dependencies (e.g., .NET 6 or higher) and specific Python version compatibilities that do not directly apply to `uipath-runtime` itself.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Manage your Python project dependencies using `pip` or `uv` (e.g., `pip install -r requirements.txt`). Ensure the deployment environment has these dependencies installed. If deploying to UiPath Cloud, follow the specific packaging and deployment guidelines for including Python dependencies (e.g., using `uipath pack` command-line tool which requires `pyproject.toml` with metadata).","message":"When building custom runtimes or agents with `uipath-runtime` that rely on external Python libraries, those dependencies must be correctly installed in the Python environment where your runtime will execute. Failure to do so will result in `ModuleNotFoundError` or other runtime exceptions.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}