Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.12"
version = "0.2.13"
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 @@ -50,6 +50,7 @@ def invoke(
folder_key: Optional[str] = None,
folder_path: Optional[str] = None,
attachments: Optional[list[Attachment]] = None,
entry_point: Optional[str] = None,
parent_operation_id: Optional[str] = None,
run_as_me: Optional[bool] = None,
**kwargs: Any,
Expand All @@ -64,6 +65,7 @@ def invoke(
attachments (Optional[list]): List of Attachment objects to pass to the process.
folder_key (Optional[str]): The key of the folder to execute the process in. Override the default one set in the SDK config.
folder_path (Optional[str]): The path of the folder to execute the process in. Override the default one set in the SDK config.
entry_point (Optional[str]): The entry point to execute in a multi-entry-point process package.
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.

Expand Down Expand Up @@ -101,6 +103,7 @@ def invoke(
input_data=input_data,
folder_key=folder_key,
folder_path=folder_path,
entry_point=entry_point,
parent_span_id=kwargs.get("parent_span_id"),
parent_operation_id=parent_operation_id,
run_as_me=run_as_me,
Expand All @@ -126,6 +129,7 @@ async def invoke_async(
folder_key: Optional[str] = None,
folder_path: Optional[str] = None,
attachments: Optional[list[Attachment]] = None,
entry_point: Optional[str] = None,
parent_operation_id: Optional[str] = None,
run_as_me: Optional[bool] = None,
**kwargs: Any,
Expand All @@ -140,6 +144,7 @@ async def invoke_async(
attachments (Optional[list]): List of Attachment objects to pass to the process.
folder_key (Optional[str]): The key of the folder to execute the process in. Override the default one set in the SDK config.
folder_path (Optional[str]): The path of the folder to execute the process in. Override the default one set in the SDK config.
entry_point (Optional[str]): The entry point to execute in a multi-entry-point process package.
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.

Expand Down Expand Up @@ -172,6 +177,7 @@ async def main():
input_data=input_data,
folder_key=folder_key,
folder_path=folder_path,
entry_point=entry_point,
parent_span_id=kwargs.get("parent_span_id"),
parent_operation_id=parent_operation_id,
run_as_me=run_as_me,
Expand Down Expand Up @@ -318,6 +324,7 @@ def _invoke_spec(
*,
folder_key: Optional[str] = None,
folder_path: Optional[str] = None,
entry_point: Optional[str] = None,
parent_span_id: Optional[str] = None,
parent_operation_id: Optional[str] = None,
run_as_me: Optional[bool] = None,
Expand All @@ -329,6 +336,9 @@ def _invoke_spec(
}
self._add_tracing(payload, UiPathConfig.trace_id, parent_span_id)

if entry_point:
payload["EntryPointPath"] = entry_point

if parent_operation_id:
payload["ParentOperationId"] = parent_operation_id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def test_invoke(
) -> None:
process_name = "test-process"
input_arguments = {"key": "value"}
entry_point = "invoice_tools/extract.py:extract_invoice_data"
httpx_mock.add_response(
url=f"{base_url}{org}{tenant}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs",
status_code=200,
Expand All @@ -56,7 +57,7 @@ def test_invoke(
},
)

job = service.invoke(process_name, input_arguments)
job = service.invoke(process_name, input_arguments, entry_point=entry_point)

assert isinstance(job, Job)
assert job.key == "test-job-key"
Expand All @@ -80,6 +81,7 @@ def test_invoke(
"ReleaseName": process_name,
"InputArguments": json.dumps(input_arguments),
"Source": "AgentService",
"EntryPointPath": entry_point,
}
},
separators=(",", ":"),
Expand Down Expand Up @@ -263,6 +265,7 @@ async def test_invoke_async(
) -> None:
process_name = "test-process"
input_arguments = {"key": "value"}
entry_point = "invoice_tools/extract.py:extract_invoice_data"
httpx_mock.add_response(
url=f"{base_url}{org}{tenant}/orchestrator_/odata/Jobs/UiPath.Server.Configuration.OData.StartJobs",
status_code=200,
Expand All @@ -279,7 +282,9 @@ async def test_invoke_async(
},
)

job = await service.invoke_async(process_name, input_arguments)
job = await service.invoke_async(
process_name, input_arguments, entry_point=entry_point
)

assert isinstance(job, Job)
assert job.key == "test-job-key"
Expand All @@ -303,6 +308,7 @@ async def test_invoke_async(
"ReleaseName": process_name,
"InputArguments": json.dumps(input_arguments),
"Source": "AgentService",
"EntryPointPath": entry_point,
}
},
separators=(",", ":"),
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath-platform/uv.lock

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

2 changes: 1 addition & 1 deletion packages/uipath/uv.lock

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

Loading