Scaling with Fetch And Lock

Hello,

I am using the Fetch And Lock feature with C# implementation.
I got C# services with “workers” and each worker uses the FetchAndLock request to get external tasks work from the Camunda Api and redirect the response to the corresponding C# logic.
I am also using postgresql as the camunda database.
For now we are not using long bpmn workflows, by that I mean on average our end 2 end process including the bpmn flow finishes in about a minute.

But now I am facing a problem.
I need to support a blue/green deployment where we dont have downtime when we release new features etc…

So basically for example for a C# invocieService which uses camunda BPMN for invoice workflows. I can turn on invocieService instance B, have a small period in which invocieService instance A still at work, turn off invoiceService instance A.

In order to be able to do that I need to prevent a situation where both service A and service B use fetchAndLock and manage to fetch “work” for the same running instance, because it is possible that changes were made in the c# logic which only service B has.

Any chance there is a support way to achieve that which I can use in terms of Camunda?

I think ideally I would want a situation where the sent Fetch And Lock requests from service B will never return work from already running bpmn instances which started by service A but hasn’t finished yet (it is important for the small period in which both A and B will be online).

P.S.
I hope i managed to explain the situation.

I thought to update,
I decided to use the business key parameter. I control its value with some external logic.
This seem to solve the issue for me since I now got an external property which I can use as additional filter layer with which to query Camunda for the desired external tasks and basically to split them into two groups (blue, green).