Executing service task after human task sequentially

Hi, I would like to ask about executing service task after human task. E.g there is process that start with human task and is followed by two service task(implemented by delegate).

Consider there is backend app that call complete to human task. What happen is that, human task is completed, then service task are completed and then backend receive response. This happen because it is treated as one transaction Transactions in Processes | docs.camunda.org. Asynchronous continuations would split in separate transactions right ?

But are those transactions executed synchronously or asynchronously ? Service task makes API calls to backend to execute operation. BUT operation depend on variable stored(transactionally) before calling complete human task. With asynchronous continuations variable is present in operation(called by service task) but without asynchronous continuations variable is not present.

Is order of execution guaranteed with asynchronous continuations this way ?

  1. backend → human task(complete) → response to backend
  2. service task → backend operation → response to service task
  3. service task → backend operation → response to service task

If no, is it possible to achieve this order of execution ? E.g. external task or so. Thanks

Hi @TheNevim,

if the service tasks are sequential (a sequence flow from the first service task into the second service task), the process engine takes care about the sequence of activities. Even if you mark them with Async before.

Hope this helps, Ingo

Thank you for response. So do i understand it correctly that even if service task are marked with Before(asynchronous continuations) task are executed sequentially/synchronously ? Only difference is that they are in separate transactions ? If so, at least for me, naming it asynchronous continuation is a bit misleading :smiley:

Hi @TheNevim,

I’ve heard this argument some times before. It depends on the overall view of the system. Compared with the initial, synchronous invocation of java delegates the name may be a better fit than comparing it to asynchronous programming in general.

Cheers, Ingo