Set order of workflows

I have a need to run workflows in a particular order. In the UI they are ordered as I created them and they appear to run in that order (according to the audit log):

  1. Is the ordering shown in the UI a reliable way to know the order the workflow processing on the server? (ie. I don’t want to rely on the implementation of the workflow processing order in the server if that could possibly change or by chance currently just happens to match the order in the UI)
  2. Could we have a “Rearrange” for workflows just like we have a “Rearrange” for actions within a workflow? (currently I may be able to WAR by copying and disabling workflows (assuming item 1 above holds))

So it would work by gathering all workflows that might need to be triggered and process them in order. The triggering of a later workflow can be depend on the running of a prior workflow.

It seems I can play games with control flow variables but that seems overly complicated to force an order onto the workflows and makes this case a lot harder than it needs to be.

I read through Actions and Workflows: Some clarification on Order of Processing and Data Updates available when

Status Open
1 6 387
6 Comments
LeventK
Participant V

AFAIK, provided you have more than 1 WF rule set for a particular table, they are processed in an order whichever one’s conditional rule is evaluated first on the server. So FIFO rule applies.

MultiTech
Participant V

@Stephen_Ehmann You might adapt some of the techniques from this article to your use:

Stephen_Ehmann
Participant IV

a couple things I would like confirmation with below to make sure I understand how the server processes workflows.

A) would you all agree that the order of the workflows, say Wa and Wb, is indeterminate from the app code developers standpoint if no controlling triggers are used? That is, say I have Wa and Wb that both just send a simple email based on the same event, there is no guarantee on the order of Wa running first or Wb running first. Do you agree this is the current state?

B) Perhaps I am not sure about how workflows are synchronized on the server, in my simple case which of these happens:

  1. Wa executes to completion and then Wb executes to completion OR vice-versa
  2. Wa and Wb can execute concurrently, ie. one doesn’t have to have completed before the other can start and multiple workflows can be executing at the same time
    –> that is, are workflows serialized? Because if they aren’t and they can run concurrently then that renders the ordering question moot
MultiTech
Participant V

I believe things run in parallel; they’re separate processes initiated by the server, different internal server task management I would think.


I would agree with your Statement A - there is no guarentee the order your workflows will process if triggered by the same event.

  • (Maybe by name, or (thinking more technical here) the order in which the records sit inside the server - so the order in which you created them. (Just guessing )
Stephen_Ehmann
Participant IV

related to question: Conditionally send an email from a workflow - #7 by Stephen_Ehmann
where I put a repro case for the out of order workflow execution not honoring triggers.

I am able to workaround this by “inlining” the cascading expression logic into each workflow’s trigger condition so that all orderings of workflows are handled.

I am posting this here since this is the main thread about workflow ordering issues I am seeing.

I would be happy to take this up with Support@AppSheet.com but I am in prototype phase still and not a paying customer yet.

Status changed to: Open
Pratyusha
Community Manager
Community Manager