Skip to content

feat(escalation): two-phase escalation with inline task creation#528

Draft
dianagrecu-uipath wants to merge 5 commits intomainfrom
feat/two-phase-escalation-interrupt
Draft

feat(escalation): two-phase escalation with inline task creation#528
dianagrecu-uipath wants to merge 5 commits intomainfrom
feat/two-phase-escalation-interrupt

Conversation

@dianagrecu-uipath
Copy link
Contributor

***Accidentally Closed the PR opened by @saksharthakkar during a wrong rebase. Opened a new PR with the same changes ***

  • Split escalation into two phases: create task via client.tasks.create_async, then interrupt(WaitEscalation) (replaces single-phase CreateEscalation)
  • Return task_url in escalation result alongside existing task_id and assigned_to
  • Update all tests to mock the new UiPath client and tasks.create_async call

Test plan

  • Existing escalation tests pass with updated mocks
  • New TestEscalationToolCreatesTaskBeforeInterrupt tests verify two-phase flow
Screen.Recording.2026-02-05.at.9.11.01.PM.mov

saksharthakkar and others added 2 commits February 6, 2026 16:38
Create task via client.tasks.create_async before calling interrupt(WaitEscalation),
replacing the previous single-phase CreateEscalation approach. Also returns task_url
in the escalation result.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dianagrecu-uipath dianagrecu-uipath force-pushed the feat/two-phase-escalation-interrupt branch from ba6872f to 483b432 Compare February 6, 2026 14:39
)
async def escalate():
client = UiPath()
task = await client.tasks.create_async(
Copy link
Member

Choose a reason for hiding this comment

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

Langgraph re-executes the interrupted node on resumption (please make sure the task isn't created twice)

Copy link
Contributor

Choose a reason for hiding this comment

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

good point! I've added @task decorator to make sure task isn't created twice. Verified using logs in hacked-coded process in OR.

image

Copy link
Contributor

@valentinabojan valentinabojan left a comment

Choose a reason for hiding this comment

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

We need to make sure the task is not created again when the node is re-executed after resume.

@valentinabojan valentinabojan self-requested a review February 6, 2026 15:27
@dianagrecu-uipath dianagrecu-uipath marked this pull request as draft February 6, 2026 15:28
saksharthakkar and others added 2 commits February 6, 2026 12:25
Prevents duplicate task creation on graph resume by caching the
create_async result in the checkpointer via LangGraph's @task decorator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants