Skip to content

Reset to pending workflow task when reapplying to a closed workflow with no completed workflow task#10899

Draft
jiechenz wants to merge 2 commits into
mainfrom
jiechenz/skip-reapply-pending-task
Draft

Reset to pending workflow task when reapplying to a closed workflow with no completed workflow task#10899
jiechenz wants to merge 2 commits into
mainfrom
jiechenz/skip-reapply-pending-task

Conversation

@jiechenz

@jiechenz jiechenz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What changed?

When replication reapplies events (e.g. signals/updates) to a closed workflow that has no completed workflow task, the reset now anchors at the workflow's pending workflow task instead of failing on the EmptyEventID anchor

The reset anchor is chosen as follows:

Scenarios (closed current+active workflow) and their test coverage

# Situation Reset anchor Outcome Test
1 Has a completed workflow task LastCompletedWFTStartedEventId reset runs ..._ResetFailed, ..._ResetError
2 No completed WFT, no pending task none (stays Empty) reapply errors → task retried ..._NoWorkflowTaskBoundary
3 No completed WFT, pending is transient / speculative none (skipped) reapply errors → task retried ..._TransientWorkflowTaskNotUsable
4 No completed WFT, real pending, started StartedEventID reset runs ..._StartedPendingWorkflowTask
5 No completed WFT, real pending, scheduled only ScheduledEventID reset runs ..._PendingWorkflowTask

Why?

Tell your future self why have you made these changes.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

jiechenz and others added 2 commits June 12, 2026 14:32
…low task

Anchor the reset to the pending workflow task when there is no completed
workflow task. Resets to a real pending task (scheduled/started) are
supported by the resetter; transient and speculative pending tasks are
skipped as they have no persisted WorkflowTaskScheduled event.

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

1 participant