Best practices for safely rolling out workflow changes with rolling deployments

Hi,

We’re looking for guidance on how to safely roll out workflow changes in a production environment where we follow rolling deployments (i.e., deploy to canary hosts first, then gradually roll out to the rest).

Even when using patch versioning, we face a challenge:

Let’s say a new activity is introduced and guarded with a patch API. If a workflow starts executing on a canary host (which has the new code), and then the same workflow execution is picked up by another worker not yet upgraded, it will fail since the activity code isn’t present there yet.

We considered combining patch versioning with worker versioning, but the documentation mentions that worker versioning is incompatible with rolling deployments.

Given this setup, is there any recommended or alternative approach to safely roll out workflow changes (e.g., adding activities or changing control flow) in environments with rolling deployments?

Thanks in advance!