-
Notifications
You must be signed in to change notification settings - Fork 20
feat: add suspend/resume support for RPA invocations in evaluations #1083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Quick Testing GuideInstall the Dev Versionpip install git+https://github.com/UiPath/uipath-python@v2.4.9-dev.suspend-resumeRun Quick Testcd samples/event-trigger
# Test 1: Direct runtime test
python -c "
import asyncio
from uipath.functions.runtime import UiPathFunctionsRuntime
async def test():
runtime = UiPathFunctionsRuntime(
'test_suspend_resume_agent.py',
'main',
'test_suspend_resume_agent'
)
result = await runtime.execute({'query': 'Test'})
print(f'✓ Status: {result.status}')
print(f'✓ Has Trigger: {result.trigger is not None}')
if result.trigger:
print(f'✓ Process: {result.trigger.payload[\"process_name\"]}')
asyncio.run(test())
"
# Test 2: Evaluation test
uipath eval test_suspend_resume_agent evaluations/test_suspend_resume.json --output-file test_output.json
cat test_output.json | python -m json.tool | grep -A 5 "status"Expected Results✅ Status: Key Files Changed
Tag: |
This change implements the suspend/resume pattern for RPA process invocations
within the evaluation runtime, ensuring evaluations can pause when waiting for
external job completion and resume after the job finishes.
Key Changes:
1. Functions Runtime (src/uipath/functions/runtime.py):
- Added _detect_langgraph_interrupt() method to detect LangGraph's
__interrupt__ field and extract trigger information
- Modified execute() to check for interrupts and return SUSPENDED status
- Converts InvokeProcess objects to UiPathResumeTrigger for serverless executor
2. Evaluation Runtime (src/uipath/_cli/_evals/_runtime.py):
- Added SUSPENDED status detection after agent execution
- Populates agentExecutionOutput with trigger data when suspended
- Skips evaluator execution for suspended runs
- Publishes EvalRunUpdatedEvent with suspended status to event bus
3. Test Agent (samples/event-trigger/test_suspend_resume_agent.py):
- Updated to use MemorySaver checkpointer (required for LangGraph interrupts)
- Returns raw dict to preserve __interrupt__ field for runtime detection
The implementation follows the established pattern from UiPathResumableRuntime
and ensures proper trigger extraction and status handling throughout the
evaluation lifecycle.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit adds three key features to support suspend/resume in evaluations: 1. Add --resume option to uipath eval command - Added resume flag to CLI arguments - Passed through to UiPathEvalContext - Enables resuming suspended evaluations 2. Use known execution_id for single runtime runs - Added job_id field to UiPathEvalContext - Passed ctx.job_id from UiPathRuntimeContext to eval context - UiPathEvalRuntime now uses job_id as execution_id when available - Falls back to UUID generation when job_id is None 3. Return inner runtime triggers to eval runtime result - Collect all triggers from evaluation run results - Pass triggers through to top-level UiPathRuntimeResult - Enables serverless executor to detect and process suspend triggers - Preserves trigger information from nested runtime executions These changes work with the suspend/resume detection already implemented to enable full suspend/resume flow for RPA process invocations in evaluations. Testing will be done with the test agent in uipath-langchain-python repo.
…runtime Added detailed logging to track the suspend/resume flow: Execution Start: - Log execution ID, job ID, and resume mode status - Clear indication when resume mode is enabled Suspension Detection: - Log when SUSPENDED status is detected - Show number of triggers extracted - Display each trigger's details Trigger Pass-through: - Log trigger collection from all evaluation runs - Show count and details of triggers being passed through - Clear confirmation when triggers reach top-level result This makes the suspend/resume mechanism transparent and easy to debug for both development and production troubleshooting.
The draw.io diagram is not working properly. Testing will be done in the uipath-langchain-python repo sample instead.
0a124f0 to
a35d2a5
Compare
|
Just to understand, so the |
Summary
Adds support for suspend/resume pattern in evaluation runtime, enabling agents to suspend execution when invoking RPA processes and resume after completion.
Key Changes
Suspend Detection (_runtime.py)
UiPathRuntimeStatus.SUSPENDEDafter agent executionResume Support (cli_eval.py)
--resumeflag to evaluation CLITrigger Pass-Through
interruptId: Unique interrupt identifiertriggerType: Type of trigger (e.g., "Api")payload: InvokeProcess details (process name, input arguments, folder path)Comprehensive Logging
Testing
Testing is done via the sample agent in the companion PR: UiPath/uipath-langchain-python#397
Related
Companion PR for sample agent: UiPath/uipath-langchain-python#397