I don’t know if I understood the question correctly, but I’ll try to help!
For your use case, you can do it as follows:
Create an Expanded sub process and this sub process will be a multi-instance, and inside it you will place your user task and your zeebe worker code, according to my model below:
With this, you will define a single instance containing a list that will be validated upon entering the multi-instance and will have one execution per element contained in this list.
So imagine that you have an instance that is entering the multi-instance, and this instance contains a process variable that stores a list with 10 elements. As soon as your instance enters the multi-instance, a sub-instance will be created for each element of your array, and so for each user task answered, the zeebe worker will be called.
With this, you will have 10 user tasks to answer, and 10 calls to the zeebe worker… remember that the zeebe worker will only be executed after completing the user task for that specific element of the array in the multi-instance.
My use case is, each user task needs to assign to different user based on group / candidate users and every one needs to complete the task before it goes next user task/service task.
Your list can be an array of objects, and for each object/element in your list you can contain the candidate responsible for completing this task… and in the candidate users or candidate groups field you can do this dynamically using a FEEL expression.
With this you can “play” with validations… for example, for each candidate user who completed a task, you add him to a process variable that will store all those who have already executed the user task… and only allow the user to complete the task if he is not in this array of users who have already completed it…
I don’t know all the context you need, but I believe this is already a “guide” to help you.