Execution order of parallel external tasks

Hy all,
I have an scenario like this:

I like to execute activities in parallel in external tasks workers. Because I’m on kuberntes it is very easy to scale up the number of external task workers listen for the event of the parallel activity. If for example I scale up my external task service to 5 instances, I’m able to process the parallel activity 5 times in parallel. Very smart and everything is working :wink:

But I sometimes I run in the following problem: When I execute multiple process instances of this process at the same time, I realized that the external tasks workers doesn’t matter about the “order of parallel activities”. So it could happen that if I have 5 process instances started and 5 external tasks workers, worker 1 fetches activity of process instance 1, worker 2 of process instance 2 and so on.

Is there a way to say camunda: Please fetch and lock the parallel activities in order? So that first all activities of process instance 1 are fetched and locked by the external task workers before process instance 2 is processed?

Thanks in advance,

Richard

HI @rich0rd

Generally speaking if you need them to run in any kind of order I’d suggest running them sequentially. Parallel execution is optimized in a way that assumes the order isn’t important.

That said you can probably take advantage of the priority mechanism built into external tasks to ensure they are picked up in order or priority and link that priority to the order you want.