Skip to main content
Skip table of contents

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.

image-20240619-171359.png

The step sequencing settings available on all workflow actions.

When a workflow action fails or is disabled, you may select one of the following step sequencing settings:

  • (error) Quit the workflow reporting failure (Default)
    Halts the workflow at the current action, and marks the workflow run as failed.

  • (tick) 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.

(tick) Success

(error) Fail the workflow

:wf-iqa: Fetch IQA Data

:wf-iqa: Fetch IQA Data

Fetch the IQA data from the iUpdate job.

(tick) 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.

(tick) Success

➡️ Go to a step

:wf-iupdate: iDMS iUpdate 2

:wf-gate: Gate

:wf-gate: Gate

Exit the workflow reporting “success”.

(tick) Success

(tick) Success

:wf-iupdate: iDMS iUpdate 2

Creates an error record in a panel.

⚫ Did Not Run

(error) Fail the workflow

:wf-http: HTTP Request

Notifies staff via MS Teams.

⚫ Did Not Run

(error) 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.

(tick) Success

(error) Fail the workflow

:wf-iqa: Fetch IQA Data

:wf-iqa: Fetch IQA Data

Fetch the IQA data from the iUpdate job.

(tick) 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.

(error) 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.

(tick) Success

(error) Fail the workflow

:wf-http: HTTP Request

Notifies staff via MS Teams.

(tick) Success

(error) Fail the workflow

(tick) Success (Implicit)

Let’s break down each step:

  1. The first iUpdate task runs successfully.

  2. The IQA data was fetched successfully.

  3. The HTTP request failed.

    1. 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.

  4. The second iDMS iUpdate task runs successfully.

  5. The second HTTP Request runs successfully.

  6. 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.

(tick) Success

(error) Fail the workflow

:wf-iqa: Fetch IQA Data

:wf-iqa: Fetch IQA Data

Fetch the IQA data from the iUpdate job.

(error) 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.

(tick) Success

(error) Fail the workflow

:wf-http: HTTP Request

Notifies staff via MS Teams.

(error) Failed

(error) Fail the workflow

(error) 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”.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.