Been dealing with this bug for months - Race condition?

I need to look into this, maybe watch a tutorial. I built this app about a year ago before they added this new way of running workflows. You think it would help avoid the race condition?

Yes it does. I went crazy many times looking at “strange” behavior only finally understood that api calls, custom state changes, workflow triggers all behave differently when it comes to order of things. Trigger comes first, than API call and next the rest.

So for instance

Step 1: customer state change, step 2 api call, step 3 trigger custom workflow becomes…

Step 3, step 2 and lastly the custom state change

The ability to define data input and output for a custom workflow is very powerful. You can build very robust and easy to maintain workflows this way.