Message order on automatic transitions

Let’s say I have a workflow with 2 steps: A and B. Step A transitions automatically to step B.

I have a component that produces messages, and calls step A 2 times.
[A] - [A]
[A] → A (executing)
One request gets executed, the other one is queued. When the first execution of A finishes, it queues a transitions to B. So A executes again.
[B] → A

Is there a way to prioritize automatic transitions over the ones already queued up?

Hi @pisuika,

Actually you are in charge of execution. Once you start Step A, set some status in your workflow state and based on that status you can reject the second call. Something similar to the second snippet in this section Implementing Workflows :: Akka Documentation

if (currentState().status() == WAITING_FOR_ACCEPTATION) { 
    //do sth
  } else { 
    //reject the call
  }

Thanks for your reply. We were thinking on a different approach where we didn’t have to reject the second call and just leave it queued up. If it isn’t possible we can find another way to accomplish what we want.