Skip to content
Open
2 changes: 1 addition & 1 deletion packages/uipath-platform/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-platform"
version = "0.2.26"
version = "0.2.27"
description = "HTTP client library for programmatic access to UiPath Platform"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def invoke(
attachments: Optional[list[Attachment]] = None,
parent_operation_id: Optional[str] = None,
run_as_me: Optional[bool] = None,
entry_point_path: Optional[str] = None,
Comment thread
UiPathPetruPopa marked this conversation as resolved.
**kwargs: Any,
) -> Job:
"""Start execution of a process by its name.
Expand All @@ -66,6 +67,7 @@ def invoke(
folder_path (Optional[str]): The path of the folder to execute the process in. Override the default one set in the SDK config.
parent_operation_id (Optional[str]): The parent operation ID for BTS tracking correlation.
run_as_me (Optional[bool]): If True, the job will run under the calling user's identity.
entry_point_path (Optional[str]): The workflow to run, as a package-relative path. Omitted from the request when unset, which runs the release's configured entry point.

Returns:
Job: The job execution details.
Expand Down Expand Up @@ -104,6 +106,7 @@ def invoke(
parent_span_id=kwargs.get("parent_span_id"),
parent_operation_id=parent_operation_id,
run_as_me=run_as_me,
entry_point_path=entry_point_path,
)
response = self.request(
spec.method,
Expand All @@ -128,6 +131,7 @@ async def invoke_async(
attachments: Optional[list[Attachment]] = None,
parent_operation_id: Optional[str] = None,
run_as_me: Optional[bool] = None,
entry_point_path: Optional[str] = None,
**kwargs: Any,
) -> Job:
"""Asynchronously start execution of a process by its name.
Expand All @@ -142,6 +146,7 @@ async def invoke_async(
folder_path (Optional[str]): The path of the folder to execute the process in. Override the default one set in the SDK config.
parent_operation_id (Optional[str]): The parent operation ID for BTS tracking correlation.
run_as_me (Optional[bool]): If True, the job will run under the calling user's identity.
entry_point_path (Optional[str]): The workflow to run, as a package-relative path. Omitted from the request when unset, which runs the release's configured entry point.

Returns:
Job: The job execution details.
Expand Down Expand Up @@ -175,6 +180,7 @@ async def main():
parent_span_id=kwargs.get("parent_span_id"),
parent_operation_id=parent_operation_id,
run_as_me=run_as_me,
entry_point_path=entry_point_path,
)

response = await self.request_async(
Expand Down Expand Up @@ -321,6 +327,7 @@ def _invoke_spec(
parent_span_id: Optional[str] = None,
parent_operation_id: Optional[str] = None,
run_as_me: Optional[bool] = None,
entry_point_path: Optional[str] = None,
) -> RequestSpec:
payload: Dict[str, Any] = {
"ReleaseName": name,
Expand All @@ -335,6 +342,11 @@ def _invoke_spec(
if run_as_me is not None:
payload["RunAsMe"] = run_as_me

# Omitted rather than sent empty: Orchestrator resolves the release's configured entry
# point when the key is absent, and rejects a path that is not in the package.
if entry_point_path:
payload["EntryPointPath"] = entry_point_path

request_spec = RequestSpec(
method="POST",
endpoint=Endpoint(
Expand Down
55 changes: 55 additions & 0 deletions packages/uipath-platform/tests/services/test_processes_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,61 @@ def test_invoke(
== f"UiPath.Python.Sdk/UiPath.Python.Sdk.Activities.ProcessesService.invoke/{version}"
)

def test_invoke_includes_entry_point_path(
self,
httpx_mock: HTTPXMock,
service: ProcessesService,
base_url: str,
org: str,
tenant: str,
) -> None:
process_name = "test-process"
httpx_mock.add_response(
url=f"{base_url}{org}{tenant}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs",
status_code=200,
json={"value": [{"Key": "k", "State": "Running", "Id": 1}]},
)

service.invoke(process_name, entry_point_path="Workflows/Main.xaml")

sent_request = httpx_mock.get_request()
if sent_request is None:
raise Exception("No request was sent")

assert sent_request.content.decode("utf-8") == json.dumps(
{
"startInfo": {
"ReleaseName": process_name,
"InputArguments": "{}",
"Source": "AgentService",
"EntryPointPath": "Workflows/Main.xaml",
}
},
separators=(",", ":"),
)

def test_invoke_omits_an_empty_entry_point_path(
self,
httpx_mock: HTTPXMock,
service: ProcessesService,
base_url: str,
org: str,
tenant: str,
) -> None:
httpx_mock.add_response(
url=f"{base_url}{org}{tenant}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs",
status_code=200,
json={"value": [{"Key": "k", "State": "Running", "Id": 1}]},
)

service.invoke("test-process", entry_point_path="")

sent_request = httpx_mock.get_request()
if sent_request is None:
raise Exception("No request was sent")

assert "EntryPointPath" not in sent_request.content.decode("utf-8")

def test_invoke_without_input_arguments(
self,
httpx_mock: HTTPXMock,
Expand Down
4 changes: 2 additions & 2 deletions packages/uipath-platform/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/uipath/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "uipath"
version = "2.14.12"
version = "2.14.13"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
dependencies = [
"uipath-core>=0.5.30, <0.6.0",
"uipath-runtime>=0.13.1, <0.14.0",
"uipath-platform>=0.2.25, <0.3.0",
"uipath-platform>=0.2.27, <0.3.0",
"click>=8.3.1",
"httpx>=0.28.1",
"pyjwt>=2.10.1",
Expand Down
1 change: 1 addition & 0 deletions packages/uipath/src/uipath/agent/models/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ class AgentProcessToolProperties(BaseResourceProperties):

folder_path: Optional[str] = Field(None, alias="folderPath")
process_name: Optional[str] = Field(None, alias="processName")
entry_point_path: Optional[str] = Field(None, alias="entryPointPath")


class AgentProcessToolResourceConfig(BaseAgentToolResourceConfig):
Expand Down
6 changes: 3 additions & 3 deletions packages/uipath/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading