Workflow sequence

Hi @emmanuel
I have a question regarding the workflow sequence.
For example when we have several workflows that are triggered by the same event (let’s say a button click), but have different conditions - when I use the debugger I see that these workflows run in a random sequence, not necessarily in the same order as they appear in the workflow tab. this makes it a bit unpredictable as of what will happen in the app sometimes as we saw an issue with one of our apps. Would it be possible to do one of the following:

  1. Define the order in which they run?
  2. or to make it so that the workflow that doesn’t have a condition always runs first and then all the other workflows that are triggered by the same event but have conditions?
    Thanks for considerations,
    Levon
2 Likes

What you see in the debugger is a bit artificial, as we need to pick an order, but what is really happening is that they run at the same time, and we can’t guarantee which one ends first (since it can often depend on external services). If your design assumes an order between the workflows, that probably means you should change your design (for instance, only have one workflow so that the sequence is what you want).

2 Likes

will it work if we simply schedule all the other workflows with a delay as custom events from the main workflow? or there is still a risk that they will run at the same time with the main one?

You can do that if the delays are long enough, but 1) it’s slower 2) it’s hacky. We can’t guarantee the end of a workflow for the reasons I explained before. I would strongly suggest to change the design.

1 Like