Assume I have a simple BPN with three process steps. 1) gather info from user, for example via web, chat or any channel, 2) process the input and based on other systems generate a response and 3) present the response to the user. Building a worker for (2) is straightforward for example pick a job from the queue, process the payload and put back updated payload. The (2) worker microservice doesn’t have to care about which workflow instances. It just picks from the queue and puts back the result.
But 1) and 3) only needs to pick jobs from the same workflow instance because otherwise the user would get other users response. So 1) and 3) workers have to only pick jobs for a certain jobtype AND workflow instance ID. And ideally not being able to access any other workflow instance. A “session” concept so to say.
What would be the best process, worker design approach to solve this problem?