Blocking local workflows while API Workflow is in progress

I’m triggering the same API workflow from several places in my app , and i want to make sure that the user doesnt go forward with any other local/page workflows before the API workflow completes, because the data-changes by the API workflow might have implications on the conditions on the page.

Whats the solution for this?

I was thinking about having an “API in Progress?” field on the user, and change to “yes” whenever an API is triggered which will show an un-closeable popup, and each API workflow will have an action at the end that will change field to “no”, which will hide the popup.

Is there a better way?

Create a a “thing” in your database called “Workflow In Progress”.
Associate this thing with a user.
While the API workflow is in progress set the “thing” to true
Once the workflow is completed set it to false.

Only allow the user to move forward if the thing is false
You will probably need to implement a polling mechanism on the client side to check if the “thing” is set to false

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.