Skip to content
Merged
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: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ test:uipath-integrations:
test:uipath-runtime:
- changed-files:
- any-glob-to-any-file: ['packages/uipath-core/src/**/*.py']
- changed-files:
- any-glob-to-any-file: ['packages/uipath/pyproject.toml']
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.1.91"
version = "0.2.0"
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 @@ -453,6 +453,23 @@ class UiPathResumeTriggerCreator:
Implements UiPathResumeTriggerCreatorProtocol.
"""

async def create_triggers(self, suspend_value: Any) -> list[UiPathResumeTrigger]:
"""Create resume triggers from a suspend value.

Most values create a single trigger. A list or tuple creates sibling
triggers for the same interrupt; whichever one fires first resumes it.
"""
if isinstance(suspend_value, (list, tuple)):
if not suspend_value:
raise ValueError("At least one interrupt model is required.")
return [
await self.create_trigger(child_suspend_value)
for child_suspend_value in suspend_value
]

resume_trigger = await self.create_trigger(suspend_value)
return [resume_trigger]

async def create_trigger(self, suspend_value: Any) -> UiPathResumeTrigger:
"""Create a resume trigger from a suspend value.

Expand Down Expand Up @@ -1040,6 +1057,10 @@ async def create_trigger(self, suspend_value: Any) -> UiPathResumeTrigger:
"""
return await self._creator.create_trigger(suspend_value)

async def create_triggers(self, suspend_value: Any) -> list[UiPathResumeTrigger]:
"""Create resume triggers from a suspend value."""
return await self._creator.create_triggers(suspend_value)

async def read_trigger(self, trigger: UiPathResumeTrigger) -> Any | None:
"""Read a resume trigger and convert it to runtime-compatible input.

Expand Down
39 changes: 39 additions & 0 deletions packages/uipath-platform/tests/services/test_hitl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2109,6 +2109,45 @@ def test_wait_until_requires_timezone_aware_resume_time(self) -> None:
with pytest.raises(ValueError, match="resume_time must include timezone"):
WaitUntil(resume_time=datetime(2026, 6, 27, 20, 14, 49))

@pytest.mark.anyio
async def test_create_resume_triggers_for_interrupt_list(
self,
) -> None:
"""Test an interrupt list creates sibling triggers for the same interrupt."""
job_key = "test-job-key"
wait_job = WaitJob(
job=Job(
id=1234,
key=job_key,
folder_key="d0e09040-5997-44e1-93b7-4087689521b7",
),
process_folder_path="/test/path",
)
wait_until = WaitUntil(
resume_time=datetime(2026, 6, 27, 23, 14, 49, tzinfo=timezone.utc)
)

processor = UiPathResumeTriggerCreator()
triggers = await processor.create_triggers([wait_job, wait_until])

assert len(triggers) == 2
job_trigger, timer_trigger = triggers
assert job_trigger.trigger_type == UiPathResumeTriggerType.JOB
assert job_trigger.item_key == job_key
assert timer_trigger.trigger_type == UiPathResumeTriggerType.TIMER
assert timer_trigger.trigger_name == UiPathResumeTriggerName.TIMER
assert timer_trigger.resume_time == datetime(
2026, 6, 27, 23, 14, 49, tzinfo=timezone.utc
)

@pytest.mark.anyio
async def test_create_resume_triggers_rejects_empty_interrupt_list(self) -> None:
"""Test an interrupt list must include at least one model."""
processor = UiPathResumeTriggerCreator()

with pytest.raises(ValueError, match="At least one interrupt model"):
await processor.create_triggers([])


class TestDocumentExtractionModels:
"""Tests for document extraction models."""
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.

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.12.8"
version = "2.13.0"
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.26, <0.6.0",
"uipath-runtime>=0.12.1, <0.13.0",
"uipath-platform>=0.1.91, <0.2.0",
"uipath-platform>=0.2.0, <0.3.0",
"click>=8.3.1",
"httpx>=0.28.1",
"pyjwt>=2.10.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/uipath/uv.lock

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

Loading