Skip to content

Add patch activation callback#1639

Merged
Sushisource merged 1 commit into
mainfrom
patch-activation-callback
Jul 16, 2026
Merged

Add patch activation callback#1639
Sushisource merged 1 commit into
mainfrom
patch-activation-callback

Conversation

@Sushisource

Copy link
Copy Markdown
Member

What was changed

Added an experimental Worker(..., patch_activation_callback=...) option that lets a worker decide whether the first newly encountered, non-replay workflow.patched call activates a patch.

The callback receives frozen PatchActivationInput containing workflow information and the patch ID. Its strict boolean decision is memoized for the workflow run. Declined patches return False without recording a marker, while replay, existing history markers, and deprecated patches retain their existing behavior. Replayers do not invoke the callback.

This ports the behavior introduced by temporalio/sdk-ruby#481.

Why?

This allows workflow changes using workflow.patched to roll out gradually without every new-code worker immediately recording a marker that older workers cannot replay.

Testing

  • Focused patch activation and rolling-worker scenarios: 11
  • Targeted mypy checks
  • Ruff import and formatting checks
  • Diff and sdk-core submodule cleanliness checks

@Sushisource Sushisource force-pushed the patch-activation-callback branch 3 times, most recently from d1ca3f5 to 477ca3c Compare July 14, 2026 23:51
@Sushisource Sushisource marked this pull request as ready for review July 14, 2026 23:54
@Sushisource Sushisource requested a review from a team as a code owner July 14, 2026 23:54
@Sushisource Sushisource force-pushed the patch-activation-callback branch 2 times, most recently from f09eadb to ddcb316 Compare July 15, 2026 17:34
@Sushisource Sushisource force-pushed the patch-activation-callback branch from ddcb316 to 80ad2d0 Compare July 15, 2026 18:12
@Sushisource Sushisource merged commit 663ea64 into main Jul 16, 2026
30 of 31 checks passed
@Sushisource Sushisource deleted the patch-activation-callback branch July 16, 2026 18:47
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.

2 participants