Does a step on a backend workflow wait for previos step to complete before starting? or is it like frontend workflows that executes in order but do not wait for the previews step to complete?
i have a very long chain of steps that do heavy database work, and some require to wait for completion of previous steps
If you use the result of a previous action as input for a later action (example screenshot below) you would expect the action will wait for completion of the previous action (the one whose results are used at least).
This post answers all your questions
It should be on the documentation.
General rules about how workflows run:
Frontend workflow actions run in order but the next action does not wait on the previous action to be complete before triggering.
Backend workflows are triggered as soon as the workflow is triggered, independently from steps. For example, a âSchedule API Workflowâ action will be triggered as soon as the workflow is triggered even if it is placed last in the workflow action sequence.
Custom events run in sequence, not parallel. If Workflow 1 triggers a custom event that starts Workflow 2, Workflow 2 will complete before the remaining actions in Workflow 1 run.
Searches arenât always immediately updated with new data. So if you create a new item, and then try to retrieve it via search, it may or may not work; you should not rely on this.
Retrieving a thing from âresult of step Xâ where step X is the âCreateâŚâ step should always be safe.
Workarounds to help achieve workflow consistency:
When a workflow trigger (eg. a button) can have multiple results based on conditions, it is safer to create multiple workflows and place the conditions at the workflow level instead of creating one workflow with all possible actions and placing the conditions at the action level.
In a workflow with two actions, if Step 2 is using a condition based on a search depending on data manipulated in Step 1, then Step 1 should be implemented into a custom event to make sure it is finished before moving on to Step 2.
If a backend workflow should be triggered after other steps in the workflow, then it should be implemented in a custom event placed after the steps that need to come first.
The safest way to use data from one step to another is to use the âresult of step Xâ operators instead of searches.
We do not offer the explicit ability for an action to wait for a workflow to be over before moving on to the next step; however, using âadd a pause before next actionâ action is usually an effective workaround.
this is the post that triggered my question, it says frontend workflow run in order but actions⌠so what about backend workflows? i cant find any answer on the docs