Dynamic workflow version implementation

Hi team,
I have following use case:
The workflow system should support the concept of active multiple versions such a way that if some modifications are made in the current workflow design, all the production users should be able to run the older version, and for a group of sanity users, we need to enable the latest version with the modifications. Once the sanity testing is over, we have to switch the production users to latest version. How I can achieve this? (There can be modifications in the main process as well as child process)

Also Is there any mechanism in temporal to support dynamic workflow invocation if the version number is provided as input?

Thanks in advance

Take a look at Worker Versioning feature see if it fits your use case. Otherwise you could use different tasks queues, just note that executions on the current prod need to finish on that task queue even if you move client traffic to the promoted new prod.

hi @tihomir
Thanks for the response. I am quite confused with the versioning feature.

int version = Workflow.getVersion(“updateAdded”, Workflow.DEFAULT_VERSION, 1);
if(version ==1) {
activities.updateRequest(requestDto);
}else {
activities.validateRequest(requestDto);
}

I have few workflow executions which were started already. Once I add this change and restart the worker, what I observe is both the already started executions and newly executions are picking the new branch against the condition for version=1.
My requirement is already running execution should continue in older versions and only newly created instances(after version change deployment) should pick up the new change. How can I achieve this