Custom task execution order

I’m trying to run process like this:
image

The “action” calls method that sends message to external system and ends. After “action” is finished, external system sends message “result1” or “result2” to the process, but often the subscriptions are not created yet, so the event does not start.

Is it possible to create event subscriptions always as first and run “action” after execution is waiting for message?

I’ve tried using parallel gateway, but it didn’t work always because sometimes the action was just faster than the event gateway part.

Thanks for advice!

You can use this pattern:

This will only work properly if you ensure there’s an async before marked on your action.
This pattern will ensure that you’re always waiting to receive the response back BEFORE you send the request so you shouldn’t miss a response.

2 Likes