Runtime abstractions and contracts for the UiPath Python SDK.
Overview
uipath-runtime provides the foundational interfaces and base contracts for building agent runtimes in the UiPath ecosystem. It defines the protocols that all runtime implementations must follow and provides utilities for execution context, event streaming, tracing, structured error handling, durable execution, and human-in-the-loop interactions.
This package is typically used as a dependency by higher-level SDKs such as:
UiPathRuntimeFactoryProtocol provides a consistent contract for discovering and creating runtime instances.
Factories decouple runtime construction (configuration, dependencies) from runtime execution, allowing orchestration, discovery, reuse, and tracing across multiple types of runtimes.
UiPathRuntimeContext manages configuration, file I/O, and logs across runtime execution.
It can read JSON input files, capture all stdout/stderr logs, and automatically write output and result files when execution completes.
from uipath.runtime import UiPathRuntimeContext, UiPathRuntimeResult, UiPathRuntimeStatus
with UiPathRuntimeContext(input_file="input.json", result_file="result.json", logs_file="execution.log") as ctx:
ctx.result = await runtime.execute(ctx.input)
# On exit: the result and logs are written automatically to the configured files
When execution fails, the context:
Writes a structured error contract to the result file.
Re-raises the original exception.
Execution Runtime
UiPathExecutionRuntime wraps any runtime with tracing, telemetry, and log collection capabilities. When running multiple runtimes in the same process, this wrapper ensures each execution's spans and logs are properly isolated and captured.
graph TB
TM[TraceManager<br/>Shared across all runtimes]
FACTORY[Factory]
RT[Runtime]
EXE[ExecutionRuntime<br/>exec-id: exec-id]
%% Factory creates runtimes
FACTORY -->|new_runtime| RT
%% Runtimes wrapped by ExecutionRuntime
RT -->|wrapped by| EXE
%% TraceManager shared with all
TM -.->|shared| EXE
%% Execution captures spans to TraceManager
EXE -->|captures spans| TM
%% Styling
style TM fill:#e1f5ff,stroke:#0277bd,stroke-width:3px
style FACTORY fill:#f3e5f5
style RT fill:#fff3e0
style EXE fill:#e8f5e9
This example demonstrates an orchestrator runtime that receives a UiPathRuntimeFactoryProtocol, creates child runtimes through it, and executes each one via UiPathExecutionRuntime, all within a single shared UiPathTraceManager.
This repository includes a complete blueprint for building new framework integrations using Claude Code (or any AI coding assistant):
INTEGRATION_GENOME.md — A structured, phase-by-phase specification that guides you through building a full UiPath runtime integration for any Python agentic framework. Covers project scaffolding, config/loader, schema inference, execute/stream, HITL, factory registration, LLM Gateway, and CLI middleware.
CLAUDE.md — Project instructions and structure overview for AI-assisted development.
Works well with
Use together with uipath-runtime: extensions, drivers, servers and companion tools.
uipathPythie’s Index: 87Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools.1.1M downloads/mo
uipath-langchainPythie’s Index: 86Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform452.2K downloads/mo