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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
dependencies = [
"uipath-core>=0.2.0, <0.3.0",
"uipath-runtime>=0.6.0, <0.7.0",
# TODO: Change back to "uipath-runtime>=0.7.0, <0.8.0" once PR #74 is merged and released
"uipath-runtime @ git+https://github.com/UiPath/uipath-runtime-python.git@feature/wait-for-triggers",
Copy link
Contributor

Choose a reason for hiding this comment

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

fix / remove

"click>=8.3.1",
"httpx>=0.28.1",
"pyjwt>=2.10.1",
Expand Down
27 changes: 25 additions & 2 deletions src/uipath/_cli/cli_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@
is_flag=True,
help="Keep the temporary state file even when not resuming and no job id is provided",
)
@click.option(
"--wait-for-triggers",
is_flag=True,
help="Poll triggers until completion instead of suspending. Useful for local execution without orchestrator.",
)
@click.option(
"--trigger-poll-interval",
type=float,
default=5.0,
help="Seconds between poll attempts when --wait-for-triggers is enabled (default: 5.0)",
)
def run(
entrypoint: str | None,
input: str | None,
Expand All @@ -92,6 +103,8 @@ def run(
debug: bool,
debug_port: int,
keep_state_file: bool,
wait_for_triggers: bool,
trigger_poll_interval: float,
) -> None:
"""Execute the project."""
input_file = file or input_file
Expand All @@ -112,6 +125,8 @@ def run(
debug=debug,
debug_port=debug_port,
keep_state_file=keep_state_file,
wait_for_triggers=wait_for_triggers,
trigger_poll_interval=trigger_poll_interval,
)

if result.error_message:
Expand All @@ -129,7 +144,11 @@ def run(
async def execute_runtime(
ctx: UiPathRuntimeContext, runtime: UiPathRuntimeProtocol
) -> UiPathRuntimeResult:
options = UiPathExecuteOptions(resume=resume)
options = UiPathExecuteOptions(
resume=resume,
wait_for_triggers=wait_for_triggers,
trigger_poll_interval=trigger_poll_interval,
)
ctx.result = await runtime.execute(
input=ctx.get_input(), options=options
)
Expand All @@ -141,7 +160,11 @@ async def debug_runtime(
debug_bridge: UiPathDebugProtocol = ConsoleDebugBridge()

await debug_bridge.emit_execution_started()
options = UiPathStreamOptions(resume=resume)
options = UiPathStreamOptions(
resume=resume,
wait_for_triggers=wait_for_triggers,
trigger_poll_interval=trigger_poll_interval,
)
async for event in runtime.stream(ctx.get_input(), options=options):
if isinstance(event, UiPathRuntimeResult):
await debug_bridge.emit_execution_completed(event)
Expand Down