Skip to content

Conversation

@uipreliga
Copy link
Collaborator

Implement comprehensive SDK service standardization across 5 core Orchestrator services

(to fill in a feature gap required for more complete CLI)

AssetsService:
- Add list() iterator with OData support and auto-pagination
- Add exists() boolean check for asset existence
- Add get_value() convenience method
- Add delete() for asset removal
- Add async variants for all new methods
- Fix retrieve() to raise LookupError when not found

FolderService:
- Add list() iterator with OData filtering
- Add retrieve() with dual-mode lookup (display_name or key)
- Add retrieve_by_path() for path-based lookup
- Add exists() and exists_async() checks
- Add create() and delete() folder operations
- Full async/sync parity across all methods

JobsService:
- Add list() iterator for job enumeration
- Add retrieve() by job_key or job_id
- Add exists() check for job existence
- Add stop(), suspend(), resume() control operations
- Full async variants for all operations

ProcessesService:
- Add list() iterator for process/release enumeration
- Add retrieve() by key or process_id
- Add exists() check for process existence
- Add invoke() convenience wrapper
- Full async/sync parity

QueuesService (Two-Level Architecture):
Queue Definitions:
- Add list_definitions() iterator with OData support
- Add retrieve_definition() by name or key
- Add create_definition() for queue creation
- Add delete_definition() for cleanup
- Add exists_definition() check

Queue Items:
- Add create_item() for adding queue items
- Add list_items() iterator with status filtering
- Full async variants for all operations

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Oct 31, 2025
  Implement comprehensive SDK service standardization across 5 core Orchestrator
  services

  AssetsService:
    - Add list() iterator with OData support and auto-pagination
    - Add exists() boolean check for asset existence
    - Add get_value() convenience method
    - Add delete() for asset removal
    - Add async variants for all new methods
    - Fix retrieve() to raise LookupError when not found

  FolderService:
    - Add list() iterator with OData filtering
    - Add retrieve() with dual-mode lookup (display_name or key)
    - Add retrieve_by_path() for path-based lookup
    - Add exists() and exists_async() checks
    - Add create() and delete() folder operations
    - Full async/sync parity across all methods

  JobsService:
    - Add list() iterator for job enumeration
    - Add retrieve() by job_key or job_id
    - Add exists() check for job existence
    - Add stop(), suspend(), resume() control operations
    - Full async variants for all operations

  ProcessesService:
    - Add list() iterator for process/release enumeration
    - Add retrieve() by key or process_id
    - Add exists() check for process existence
    - Add invoke() convenience wrapper
    - Full async/sync parity

  QueuesService (Two-Level Architecture):
    Queue Definitions:
    - Add list_definitions() iterator with OData support
    - Add retrieve_definition() by name or key
    - Add create_definition() for queue creation
    - Add delete_definition() for cleanup
    - Add exists_definition() check

    Queue Items:
    - Add create_item() for adding queue items
    - Add list_items() iterator with status filtering
    - Full async variants for all operations
@uipreliga uipreliga force-pushed the feat/orchestrator-services-enhancements branch from 160e2c5 to 1857837 Compare October 31, 2025 22:22
"""Async version of list()."""
current_skip = skip

while True:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation paginates using skip, which becomes extremely expensive as the offset grows. Once skip hits tens/hundreds of thousands, the Orchestrator backend starts doing deep OFFSET scans — that means high DB load, slow responses, and potential timeouts.

We already have customers with hundreds of thousands to millions of assets/jobs/queue items. With that volume, this loop will:

  • Absolutely destroy the Orchestrator API with unbounded requests
  • Cause DB pressure and latency spikes
  • Likely trigger throttling or 5xx errors at scale and an incident.

"""Async version of list() with auto-pagination."""
current_skip = skip

while True:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all while True from list methods. Without proper filters, the best we can do is retrieve top 100 results

Args:
name: Asset name (must be unique within folder)
value: Asset value
value_type: Type of asset ("Text", "Integer", "Boolean", "Credential")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also have type Secret.

asset = await self.retrieve_async(
name=name, folder_key=folder_key, folder_path=folder_path
)
return asset.value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot retrieve the value of an asset type secret or credential. We need a way to let the user know that this can only happen at runtime and mark the CLI output with "***"

self,
*,
job_keys: Optional[List[str]] = None,
job_ids: Optional[List[int]] = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't leak integer ids in the SDK. We only work with keys GUIDs

Comment on lines +84 to +89
response = self.request(
spec.method,
url=spec.endpoint,
params=spec.params,
headers=spec.headers,
).json()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many orchestrator APIs also implement rate limiting with standard headers. The Get jobs API is limited to 100 calls per minute per tenant. We need to ensure that the sdk obeys the rate limit for all endpoints (as we may introduce more limits in the future).
https://docs.uipath.com/orchestrator/automation-cloud/latest/api-guide/rate-limits#exposed-headers

skip=current_skip,
top=top,
)
response = self.request(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a user agent that can identify traffic coming from the sdk. We often needed this for mitigating incidents, or analyzing consumer patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants