Is your feature request related to a problem? Please describe.
getVersion(changeId, minSupported, maxSupported) always picks maxSupported for a new run and patched() always enables the patch on a non-replay run. So the instant a worker with new code is deployed, every new workflow on it runs the new version. During a rolling deploy this causes three problems:
- You can't stage code. Pushing code to the fleet and activating it are one event — there's no "deploy everywhere first, turn on later."
- Misrouting causes failures. Mid-deploy the fleet is mixed. A workflow that memoized the new version can land on an old worker that doesn't support it;
getVersion throws UnsupportedVersion and the task fails. It recovers on retry, but the failures fire alerts.
- No ramp. You can't move new runs onto the new version gradually (10% → 50% → 100%). It's all-or-nothing per worker.
The root cause: getVersion conflates capability (which versions a worker can run) with activation (which version new runs start on).
Describe the solution you'd like
Introduce a worker-level option that allows specifying a callback which can determine the "preferred" version to be used (or whether or not to enable the patch) the first time the new call is hit.
Additional context
Per-SDK Tickets
Is your feature request related to a problem? Please describe.
getVersion(changeId, minSupported, maxSupported)always picksmaxSupportedfor a new run andpatched()always enables the patch on a non-replay run. So the instant a worker with new code is deployed, every new workflow on it runs the new version. During a rolling deploy this causes three problems:getVersionthrowsUnsupportedVersionand the task fails. It recovers on retry, but the failures fire alerts.The root cause:
getVersionconflates capability (which versions a worker can run) with activation (which version new runs start on).Describe the solution you'd like
Introduce a worker-level option that allows specifying a callback which can determine the "preferred" version to be used (or whether or not to enable the patch) the first time the new call is hit.
Additional context
Per-SDK Tickets