HTTP session pin to the middle of running workflow

Hello guys!
I have a simple piece of BPMN-process, which is depicted on the picture below.
Current case:


In steps:
1.Calling Java Controller
2.Message to continue BPMN process is generated
3.HTTP Response returned
4.Process continues to flow, HTTP session knows nothing about how “reserve worker” completed.
Java code to publish message is:
public void publishEvent (Integer ordersId, String eventName) {
zeebeClient
.newPublishMessageCommand ()
.messageName (eventName)
.correlationKey (ordersId.toString ())
.send(). join();
}
// Method called by Java Controller
// and it totally works for CURRENT CASE

Is there any chance to pin HTTP request to workflow like on the picture with DESIRED CASE. I need the HTTP response content be dependent on “reserve worker” result
Are there any approaches? Or what can be used to achieve this functionality?
As I know there are methods in Camunda BPMN to use correlations and wait for results, but are there solutions in Zeebe?
Hope you guys able to help somehow, Im stuck:(

1 Like

Yeah, you have to do it with this pattern, using something in-memory or something like Redis to be able to scale that layer horizontally: