Skip to content

Expand SDK with Platform Management & Operational Capabilities for Coded Automations #595

@uipreliga

Description

@uipreliga

The uipath-python SDK and its extensions provide an excellent "inner loop" experience for developing and deploying individual Coded Automations. However, they lack the critical platform management and operational capabilities (the "outer loop") required for enterprise-grade automation and true end-to-end CI/CD.

This gap forces developers and DevOps engineers to rely on the Orchestrator UI or raw, undocumented API calls for essential post-deployment tasks, including:

  • Verifying successful deployments and discovering available processes.
  • Managing and monitoring running jobs operationally.
  • Configuring environment-specific variables and assets programmatically.
  • Provisioning and managing platform resources like folders and permissions.

This limitation is a significant barrier to implementing modern DevOps practices such as fully automated CI/CD pipelines, GitOps workflows, and Infrastructure-as-Code (IaC) patterns for the UiPath platform.

Proposed Solution

Expand the SDK with comprehensive, high-level services for platform management. This would transform the SDK from a developer-centric tool into an enterprise-grade platform automation tool. The proposed enhancements are organized into four key areas:


1. Process Discovery and Management (ProcessesService)

Problem: After publishing, there is no way to programmatically discover, list, or verify process deployments.

Proposed Methods:

list()

List all processes (releases) in a folder with optional filtering.

def list(
    self,
    *,
    folder_path: Optional[str] = None,
    folder_key: Optional[str] = None,
    name_contains: Optional[str] = None,
    skip: int = 0,
    take: int = 100
) -> List[Process]:
    """
    Example:
        # List all processes in the Finance folder
        processes = sdk.processes.list(folder_path="Finance")
    """
    # Implementation: GET /odata/Releases with $filter, $skip, $top

retrieve_by_name()

Get process details by an exact name match to find its key and other metadata.

def retrieve_by_name(
    self,
    name: str,
    *,
    version: Optional[str] = None, # 'latest' if not specified
    folder_path: Optional[str] = None,
    folder_key: Optional[str] = None
) -> Optional[Process]:
    """
    Example:
        process = sdk.processes.retrieve_by_name("InvoiceProcessor", folder_path="Finance")
        if process:
            print(f"Found process key: {process.key}")
    """
    # Implementation: GET /odata/Releases with an exact name filter

2. Job Operational Management (JobsService)

Problem: The SDK can start and retrieve a single job, but lacks the ability to stop, restart, or list jobs, preventing programmatic operational control.

Proposed Methods:

list()

List jobs with comprehensive filtering options for monitoring and reporting.

def list(
    self,
    *,
    process_name: Optional[str] = None,
    status: Optional[Union[str, List[str]]] = None,
    start_time_after: Optional[datetime] = None,
    folder_path: Optional[str] = None,
    take: int = 100
) -> List[Job]:
    """
    Example:
        # Get recently failed jobs for monitoring
        failed_jobs = sdk.jobs.list(
            status="Faulted",
            start_time_after=datetime.now() - timedelta(hours=1),
            folder_path="Production"
        )
    """
    # Implementation: GET /odata/Jobs with comprehensive OData filters

stop() and restart()

Provide direct operational control over jobs.

def stop(
    self,
    job_key: Union[str, uuid.UUID],
    *,
    strategy: Literal["SoftStop", "Kill"] = "SoftStop",
    folder_path: Optional[str] = None
) -> JobOperationResult:
    """
    Example:
        result = sdk.jobs.stop(job_key="...", strategy="Kill")
    """
    # Implementation: POST /odata/Jobs/UiPath.Server.Configuration.OData.StopJobs

def restart(
    self,
    job_key: Union[str, uuid.UUID],
    *,
    folder_path: Optional[str] = None
) -> Job:
    """
    Example:
        new_job = sdk.jobs.restart(job_key="...")
    """
    # Implementation: POST /odata/Jobs/UiPath.Server.Configuration.OData.RestartJobs

3. Configuration Management (AssetsService & ProcessesService)

Problem: Configuration (Assets, Environment Variables) cannot be managed programmatically from a developer or CI/CD context, breaking IaC principles.

Proposed Methods:

create() and update_value() in AssetsService

Enable asset management from an admin/developer context.

def create(
    self,
    name: str,
    value_type: Literal["Text", "Bool", "Integer", "Credential"],
    value: Optional[Any] = None,
    folder_path: Optional[str] = None
) -> Asset:
    """
    Example:
        sdk.assets.create(
            name="API_Endpoint",
            value_type="Text",
            value="https://api.production.com",
            folder_path="Production"
        )
    """
    # Implementation: POST /odata/Assets

def update_value(self, name: str, value: Any, folder_path: Optional[str] = None) -> Asset:
    """
    Example:
        sdk.assets.update_value("MaxRetryCount", 5, folder_path="Production")
    """
    # Implementation: PUT /odata/Assets({key})

set_environment_variables() in ProcessesService

Allow setting runtime environment variables for a deployed process.

def set_environment_variables(
    self,
    process_key: str,
    variables: Dict[str, str],
    *,
    folder_path: Optional[str] = None
) -> None:
    """
    Example:
        sdk.processes.set_environment_variables(
            process_key="...",
            folder_path="Production",
            variables={"LOG_LEVEL": "WARNING", "API_TIMEOUT": "60"}
        )
    """
    # Implementation: PUT /odata/Releases({key})

4. Platform Provisioning (FolderService)

Problem: The environment itself (e.g., folders) cannot be provisioned programmatically.

Proposed Methods:

create() and delete() in FolderService

Enable programmatic folder creation and deletion.

def create(
    self,
    name: str,
    *,
    parent_folder_path: Optional[str] = None
) -> Folder:
    """
    Example:
        folder = sdk.folders.create(
            name="ProjectX_Staging",
            parent_folder_path="Environments"
        )
    """
    # Implementation: POST /odata/Folders

def delete(self, folder_key: str, *, force: bool = False) -> bool:
    """
    Example:
        sdk.folders.delete(folder_key="...", force=True)
    """
    # Implementation: DELETE /odata/Folders({key})

Alternative Considerations

The only current alternative is to use the low-level sdk.api_client to make raw HTTP requests. This is brittle, requires deep knowledge of internal APIs, and defeats the purpose of an SDK. If a full implementation is not immediately feasible, we suggest prioritizing the read-only list() methods first, as they are the biggest enablers for monitoring and CI/CD verification.

Impact

Implementing these features would:

  • Enable full automation of the UiPath application lifecycle.
  • Support enterprise-grade DevOps, GitOps, and IaC patterns.
  • Reduce manual intervention and operational overhead.
  • Position the Python SDK as a first-class tool for managing the UiPath platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions