Skip to content

Commit 7e2bad4

Browse files
PG-Thomasclaude
andauthored
feat: forward EntryPointPath when a suspending caller invokes a process (#1902)
InvokeProcess gains entry_point_path and the resume-trigger creator forwards it to invoke_async, so an agent that parks on a multi-entry package reaches the entry point it asked for instead of the release default. Inert when unset. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X6aNf9YMu5FYrb7L9AHE7b
1 parent 48a7891 commit 7e2bad4

6 files changed

Lines changed: 38 additions & 3 deletions

File tree

‎packages/uipath-platform/pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-platform"
3-
version = "0.2.31"
3+
version = "0.2.32"
44
description = "HTTP client library for programmatic access to UiPath Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

‎packages/uipath-platform/src/uipath/platform/common/interrupt_models.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class InvokeProcess(BaseModel):
3535
process_folder_path: str | None = None
3636
process_folder_key: str | None = None
3737
input_arguments: dict[str, Any] | None
38+
entry_point_path: str | None = None
3839
attachments: list[Attachment] | None = None
3940

4041

‎packages/uipath-platform/src/uipath/platform/resume_triggers/_protocol.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,7 @@ async def _handle_job_trigger(
964964
attachments=value.attachments,
965965
folder_path=value.process_folder_path,
966966
folder_key=value.process_folder_key,
967+
entry_point_path=value.entry_point_path,
967968
)
968969
if not job:
969970
raise Exception("Failed to invoke process")

‎packages/uipath-platform/tests/services/test_hitl.py‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,39 @@ async def test_create_resume_trigger_invoke_process(
13351335
attachments=None,
13361336
folder_path=invoke_process.process_folder_path,
13371337
folder_key=None,
1338+
entry_point_path=None,
1339+
)
1340+
1341+
@pytest.mark.anyio
1342+
async def test_create_resume_trigger_invoke_process_entry_point_path(
1343+
self,
1344+
setup_test_env: None,
1345+
) -> None:
1346+
"""A suspending caller can pick which entry point of the process it starts."""
1347+
invoke_process = InvokeProcess(
1348+
name="TestProcess",
1349+
process_folder_path="/test/path",
1350+
input_arguments={"key": "value"},
1351+
entry_point_path="content/functions/get-purchase-order.ts",
1352+
)
1353+
1354+
mock_job = Job(
1355+
id=1234,
1356+
key="test-job-key",
1357+
folder_key="d0e09040-5997-44e1-93b7-4087689521b7",
1358+
)
1359+
mock_invoke = AsyncMock(return_value=mock_job)
1360+
1361+
with patch(
1362+
"uipath.platform.orchestrator._processes_service.ProcessesService.invoke_async",
1363+
new=mock_invoke,
1364+
) as mock_process_invoke_async:
1365+
processor = UiPathResumeTriggerCreator()
1366+
await processor.create_trigger(invoke_process)
1367+
1368+
assert (
1369+
mock_process_invoke_async.call_args.kwargs["entry_point_path"]
1370+
== "content/functions/get-purchase-order.ts"
13381371
)
13391372

13401373
@pytest.mark.anyio

‎packages/uipath-platform/uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/uipath/uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)