Sequencing and Flow Control
Overview
This page describes the sequence in which actions can be performed in the workflow.
Default Sequencing
If no settings are changed on a workflow’s trigger or actions, the following rules will apply to how the workflow is executed:
Actions are executed in the order in which they are defined in the workflow editor, from top to bottom.
If a particular action fails, the workflow is halted (no subsequent actions are run) and the workflow run is marked as “Failed”.
If all actions succeed, and the end of the workflow is reached, the workflow run finishes and the run is marked as “Success”.
Custom Sequencing
Each action can specify different sequencing logic for itself for if the action fails. This setting is applied on a per-action basis.
When a workflow action fails or is disabled, you may select one of the following step sequencing settings:
Quit the workflow reporting failure (Default)
Halts the workflow at the current action, and marks the workflow run as failed.Quit the workflow reporting success
Halts the workflow at the current action, and marks the workflow run as succeeded.➡️ Go to the specified step
Causes the workflow to “jump” to the specified action. You may only select an action from the dropdown that is after (beneath) the current one – jumping backwards is not supported.⚫ Ignore and continue
The error is ignored, and the next action in sequence is run normally.
Custom Sequencing With Expressions
By using the Gate action, you can combine custom step sequencing with an expression, enabling advanced scenarios such as:
Exit a workflow if an unexpected number of results is returned from an IQA query
Fail a workflow if a specific data condition is not met (e.g. a flag is not set in the results of an HTTP response)
Exit a workflow early (with a success status), beneficial if a previous step is set to “jump over” the gate and continue executing additional actions below
Success and Error Branching Example
With the sequencing tools above, you can have certain actions run only if a previous action succeeded or failed.
Let’s look at an example. First, we’ll assume that the workflow runs successfully:
Action | Result | Sequencing Setting | Next Action To Run | Workflow Result |
---|---|---|---|---|
:wf-iupdate: iDMS iUpdate Run a job to stage the IQA data. | Success | Fail the workflow | :wf-iqa: Fetch IQA Data | – |
:wf-iqa: Fetch IQA Data Fetch the IQA data from the iUpdate job. | Success | ➡️ Go to a step :wf-iupdate: iDMS iUpdate 2 | :wf-http: HTTP Request | – |
:wf-http: HTTP Request Upload the data to a remote API. | Success | ➡️ Go to a step :wf-iupdate: iDMS iUpdate 2 | :wf-gate: Gate | – |
:wf-gate: Gate Exit the workflow reporting “success”. | Success | – | – | Success |
:wf-iupdate: iDMS iUpdate 2 Creates an error record in a panel. | ⚫ Did Not Run | Fail the workflow | – | – |
:wf-http: HTTP Request Notifies staff via MS Teams. | ⚫ Did Not Run | Fail the workflow | – | – |
In the previous example, all actions behaved normally (there were no errors). Our Gate action was configured to simply exit the workflow reporting success, so when that action executed, the workflow stopped and had a status of “Success”.
Now, let’s look at the same example, but with a failure:
Action | Result | Sequencing Setting | Next Action To Run | Workflow Result |
---|---|---|---|---|
:wf-iupdate: iDMS iUpdate Run a job to stage the IQA data. | Success | Fail the workflow | :wf-iqa: Fetch IQA Data | – |
:wf-iqa: Fetch IQA Data Fetch the IQA data from the iUpdate job. | Success | ➡️ Go to a step :wf-iupdate: iDMS iUpdate 2 | :wf-http: HTTP Request | – |
:wf-http: HTTP Request Upload the data to a remote API. | Failed | ➡️ Go to a step :wf-iupdate: iDMS iUpdate 2 | :wf-iupdate: iDMS iUpdate 2 | – |
:wf-gate: Gate Exit the workflow reporting “success”. | ⚫ Did Not Run | – | – | – |
:wf-iupdate: iDMS iUpdate 2 Creates an error record in a panel. | Success | Fail the workflow | – | – |
:wf-http: HTTP Request Notifies staff via MS Teams. | Success | Fail the workflow | – | – |
Success (Implicit) |
Let’s break down each step:
The first iUpdate task runs successfully.
The IQA data was fetched successfully.
The HTTP request failed.
Because we have set the sequencing settings to say “Go to step ‘iDMS iUpdate 2’”, flow jumps over the Gate (which would have caused the workflow to stop!) and continues on.
The second iDMS iUpdate task runs successfully.
The second HTTP Request runs successfully.
The end of the workflow is reached. Unless otherwise specified, workflows that reach the end of their execution are automatically marked as “Success”.
Let’s look at this scenario one more time with a different outcome:
Action | Result | Sequencing Setting | Next Action To Run | Workflow Result |
---|---|---|---|---|
:wf-iupdate: iDMS iUpdate Run a job to stage the IQA data. | Success | Fail the workflow | :wf-iqa: Fetch IQA Data | – |
:wf-iqa: Fetch IQA Data Fetch the IQA data from the iUpdate job. | Failed | ➡️ Go to a step :wf-iupdate: iDMS iUpdate 2 | :wf-iupdate: iDMS iUpdate 2 | – |
:wf-http: HTTP Request Upload the data to a remote API. | ⚫ Did Not Run | ➡️ Go to a step :wf-iupdate: iDMS iUpdate 2 | – | – |
:wf-gate: Gate Exit the workflow reporting “success”. | ⚫ Did Not Run | – | – | – |
:wf-iupdate: iDMS iUpdate 2 Creates an error record in a panel. | Success | Fail the workflow | – | – |
:wf-http: HTTP Request Notifies staff via MS Teams. | Failed | Fail the workflow | – | Failed |
In this final example, the IQA failed to retrieve records, so we jumped to the error handling portion of the workflow.
However, the error handling also encountered an error - our Teams webhook failed to fire. Because this specific action is set to fail the overall workflow if this action fails, the workflow exits and the overall run is set to “Failed”.