Skip to content

Conversation

@mjnovice
Copy link

@mjnovice mjnovice commented Jan 28, 2026

Summary

  • Add wait_for_triggers and trigger_poll_interval options to UiPathExecuteOptions
  • When wait_for_triggers=True, the runtime polls triggers until completion instead of suspending
  • This keeps the process running and automatically resumes execution when triggers complete
  • Created shared TriggerPoller utility for reusable polling logic
  • Refactored UiPathDebugRuntime to use the shared TriggerPoller

Usage

# Execute with wait_for_triggers - process waits instead of suspending
result = await runtime.execute(
    input={"query": "Hello"},
    options=UiPathExecuteOptions(
        wait_for_triggers=True,  # Enable waiting mode
        trigger_poll_interval=5.0,  # Poll every 5 seconds
    )
)

Test plan

  • All existing tests pass (55/55)
  • Linting passes
  • Format checks pass
  • Manual testing with actual triggers

🤖 Generated with Claude Code

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-runtime==0.6.2.dev1000740244",

  # Any version from PR
  "uipath-runtime>=0.6.2.dev1000740000,<0.6.2.dev1000750000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-runtime = { index = "testpypi" }

Copy link
Member

@cristipufu cristipufu left a comment

Choose a reason for hiding this comment

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

Nope. Please explain what you re trying to achieve

@cristipufu
Copy link
Member

If you want polling, just wrap the runtime with a Debug Runtime instantiated with a polling interval gt 0

@mjnovice mjnovice force-pushed the feature/wait-for-triggers branch from 6bdc01f to 70476f8 Compare January 28, 2026 20:01
@mjnovice
Copy link
Author

mjnovice commented Jan 28, 2026

Nope. Please explain what you re trying to achieve

What I am trying to achieve here is experiment the option of running the uipath run ... locally with tool calls, without serverless and orchestrator (as we don't have it in Flow ).

@mjnovice mjnovice requested a review from cristipufu January 28, 2026 20:09
@mjnovice mjnovice force-pushed the feature/wait-for-triggers branch from 70476f8 to dcc49ef Compare January 28, 2026 20:12
Add a new execution option `wait_for_triggers` that allows the runtime
to poll triggers until completion instead of suspending and returning.
This keeps the process running and automatically resumes execution when
triggers complete.

Key behavior: When wait_for_triggers=True, triggers are created (to start
the work like invoking processes, creating tasks) but NOT persisted to
storage. The runtime polls inline and resumes without involving the
persistence layer.

Changes:
- Add `wait_for_triggers` and `trigger_poll_interval` options to UiPathExecuteOptions
- Create shared TriggerPoller utility for reusable polling logic
- Update UiPathResumableRuntime to loop and poll when wait_for_triggers=True
- Add skip_storage parameter to _handle_suspension() to avoid persistence
- Refactor UiPathDebugRuntime to use the shared TriggerPoller

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mjnovice mjnovice force-pushed the feature/wait-for-triggers branch from dcc49ef to b25b6f3 Compare January 28, 2026 21:11
mjnovice added a commit to UiPath/uipath-python that referenced this pull request Jan 28, 2026
…rchestrator

Add CLI flags to enable polling mode for triggers instead of suspending:
- `--wait-for-triggers`: Poll triggers until completion instead of suspending
- `--trigger-poll-interval`: Configurable poll interval (default: 5.0s)

This enables running agents locally with tool calls (InvokeProcess, CreateTask, etc.)
without requiring serverless/orchestrator infrastructure.

Usage:
  uipath run my_agent.main '{"query": "hello"}' --wait-for-triggers
  uipath run my_agent.main '{"query": "hello"}' --wait-for-triggers --trigger-poll-interval 10.0

Depends on: UiPath/uipath-runtime-python#74

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mjnovice mjnovice changed the title feat: add wait_for_triggers option to poll instead of suspend WIP feat: add wait_for_triggers option to poll instead of suspend Jan 28, 2026
@mjnovice mjnovice changed the title WIP feat: add wait_for_triggers option to poll instead of suspend feat: add wait_for_triggers option to poll instead of suspend Jan 28, 2026
@cristipufu
Copy link
Member

The whole point of triggers is persistance. If you don't persist the triggers, you don't need suspend/resume semantics. Just poll for results in the tool itself

@cristipufu cristipufu closed this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants