How to initiate a asynchronous process in camunda8

How to initiate a asynchronous process in camunda8.?
In camunda 7 we had Asynchronous continuation - before ,after and exclusive.What options we have in camunda8 ?

My use case is - I have a springboot application which will consume events and trigger the process. I do not want to wait for the response from this process flow. It should continue in asynchronous way , if any BPMN / exception is thrown in any worker , I will catch it and take appropriate action and end teh flow. Else the final output in DB.
is this achievable in camunda8 ?

If you call the CreateProcessInstance api it will return a process instance key and execute the process in an asynchronous way.

Thanks.
I have one more use case - Wherein , the spring boot rest application will consume the payload and trigger the process. In between the process flow , I will have a service task (worker) which will check the validity of the payload, if it passes, I want to send back intermediate response and continue the rest of the process asynchronously.

Can I define my service task/ worker as asynch ?

Hi @ShilpaN.Chalke,

Here is an example about this topic: camunda-8-examples/synchronous-response-springboot at main · camunda-community-hub/camunda-8-examples · GitHub

Hope this helps, Ingo

Thanks Ingo for this example.

Is it possible to achieve this use case in the BPMN flow itself?
The spring boot rest application will consume the payload and trigger the process. The process will have a payload validator which can be a service task, or we may enhance it to a call activity (subprocess). So after we complete this call activity, I would like to send the response back to the rest controller and continue rest of the flow in asynchronous way.

I was thinking may be use 2 processes, The first one terminates after validating payload with send message event (returns the response back) and trigger another process which starts with message receive event.(message correlation)

Do you have any suggestions ?

Hello @ShilpaN.Chalke ,

2 processes would be rather confusing. I would start the process with the validation task and then add a task to return the result. After this task, the rest of the process can happen.

As this is an implementation detail (from my point of view), it should not pollute the process.

Jonathan

Hi @jonathan.lukas , how do I create a service task which will return the response after the task is executed. SOmething like Asynch after in camunda 7?

Hello @ShilpaN.Chalke ,

this sounds like you actually need 2 service tasks: The first one to fetch a response and the second one to return it.

Jonathan

yes, I will create Asynchronous process instance, but instead of returning response immediately, I want 2nd service task to return the result. Is it possible to in camunda 8 ?

Hello @ShilpaN.Chalke ,

yes. The example @Ingo_Richtsmeier linked above shows exactly this behaviour.

Jonathan