Skip to content

Add patch activation callback#1639

Open
Sushisource wants to merge 1 commit into
mainfrom
patch-activation-callback
Open

Add patch activation callback#1639
Sushisource wants to merge 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 2 times, most recently from 2be3b0a to d1ca3f5 Compare July 14, 2026 22:19
@Sushisource Sushisource force-pushed the patch-activation-callback branch 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
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