Skip to main content

Flow Control Actions

Flow Actions enable you to control the flow of your Workflow.

Thumbnail If statements

An If Action directs a Workflow to run an action or set of actions if a specified condition is true.

The If action uses the following condition builder:

Thumbnail

You can use this builder to create the conditions you want to evaluate. If the condition is true the Action specified in the If statement will be executed.

Thumbnail If else

If you want to execute one set of actions if a condition is true and another if the condition is false , use an `If else Action.

Thumbnail Check If Condition

This Action button allows you to verify if a specific condition is either true or false without running the nested actions.

Thumbnail

Thumbnail Loop

The loop action enables you to run a Step or multiple Steps for each element in a list.

Thumbnail

Referencing an item in a loop

In a loop action above, we use the {{steps.S1.item}} expression or the variable picker in order to reference the current item being iterated.
To find the item reference in the variable picker, choose the specific loop step (in the case above - S1), and then then item value. During execution, the specified set of steps in the loop will be executed once for each item in the list.

Debugging a loop

In the loop action there are three debugging actions you can use to debug a loop: Run All, Run Next Item and Reset.

note

The index in a list always starts from 0.

Thumbnail

Run All

Thumbnail
  1. The Run All action runs through the entire list once.

Run Next Item

Thumbnail
  1. The Run Next Item action runs the next item in the list when iterating through the list.

Reset

Thumbnail
  1. The Rest Action resets all the changes made when applying any settings to the loop.

Advanced Settings

  1. Start from Index allows you to start your loop at a specified index in your input list. For Example:
Thumbnail
  1. Stop at Index allows you to end your loop at a specified index in your input list. For Example:
Thumbnail

Tooltip

In the following examples, when you enter the advanced settings and hover over the Run All action, a tooltip will appear explaining the starting index and the index the iteration will stop at. Similarly, when you hover over the Run Next Index action, a tooltip will appear explaining the index that will run next.

Thumbnail
Thumbnail
note

Please note when using the Run All or the Run Next Item action and an advanced setting has been applied, it will continue iterating through the list based on the previous list index displayed in the output.

For example, if you start the loop iteration in the middle of a list and then choose the Run All action, it won't restart the loop from the beginning of the list. Instead, it will resume the loop from where you left off.

The Start from Index and the Stop at Index advanced settings are applied in both edit mode as well as run time.

Keywords

  1. index - refers to the to the specified starting index.
  2. item - refers to the to the specified stopping index.
  3. total_items- refers to the total number of items in the list.

Thumbnail While Loop

The While Action enables you to run a Step or multiple Steps for as long as specified conditions are met.

Thumbnail

The Do-While Loop

The While Loop Action has an advanced option that allows you to execute your loop as a Do-while loop instead of a While Loop. A Do-while loop ensures a step or multiple steps are executed at least once. After the initial execution, it repeatedly runs the subsequent steps of code for as long as the specified conditions are met.

Thumbnail

The Advanced option also allows you to enter the maximum amount of iterations you would like your While Loop or Do-while loop to carry out.

Thumbnail

Thumbnail Set variables

The set variables Action enables users to define variables and use them in the execution of the Workflow. These variables are not exposed as parameters of the Workflow. Refer to input parameters to define input for a Workflow.

Defining and using variables:

  1. Drag Thumbnail onto the Workflow Editor to create a set variables Step.
  2. Select a variable type (boolean, numeric, string, or list.)
  3. Enter a name for the variable.
  4. Set the value for the variable. If not set, the default values are as follows:
Variable typeDefault value
BooleanFalse
Numeric0
String""
List[]

Note: Lists can be comma-separated or in JSON list format.

  1. Click the 'Add Variable' button to add more variables
  2. Use the variables in a different Step using expression language. For example: {{variables.my_variable}}.

Thumbnail Switch Case

The Switch Case action allows you to compare a given value with a series of possible values and execute different blocks of actions based on the matching case value.

Flow Control Action NameIcon
Switch case The Switch Case includes a Switch Variable which is compared to a list of case values. If any of these case values matches the Switch Variable, it prompts the execution of a particular block of actions associated with that matching case value.
CaseEach Case is a value that is compared against the Switch Variable if the value of the Switch Variable matches a Case value, the corresponding block of actions associated with that will be executed
ActionsWithin each case, you can choose any set of Actions to be performed.
Case DefaultThe default case serves as a default output option and comes into play when the Switch Variabledoes not match any of the other Case values.

Switch Case Example

Thumbnail
info

In the above Workflow example, the appropriate Case Action will be executed based on the matching values between the Case value and the Switch Variable value.

Thumbnail Run - On Error

The Run - On Error flow control is used to handle errors that might occur during the execution of a workflow.

The Run - On Error flow control utilizes a dual-step structure, consisting of Run and On Error, designed to efficiently manage any errors that might arise while executing actions within the Run phase.

Run: This step is designed for placing action(s) that contributes the overall Workflow sequence.

On Error: If there is an error during Run block, the flow will automatically shift to the On Error block. In this block, specific actions are taken to address the error. The error JSON object will be made available within the On Error block to assist in handling the error.

note

If an error occurs in the Run block but is successfully handled in the On-Error block, the workflow will continue to run after the executing the On-Error block. However, if errors occur in both the Run' and On-Error blocks, then the workflow will fail.

Thumbnail

Thumbnail Wait

The default case Action has two modes of operation. Select your mode of operation in the first parameter: Wait for.

Wait for Time Interval

This is the default mode for the Wait Action. It directs the Workflow to wait a specified amount of time until it continues running. When creating the Step, specify the number of seconds to wait.

info

The "Wait" action will have a maximum timeout of 14 days. For more information please visit the Workflows Runtime Limitations section of our documentation.

Thumbnail

Wait for Workflow Execution

This mode enables you to wait for steps in your Workflow that execute other Workflow asynchronously. The Step is paused until all the executions it is waiting for, have finished running. The output of the Wait Action will return details of the executions it is waiting for.

Define an async execution Step by choosing one of your previously defined Workflow as a Step. Then go to the Step configuration and select the Run async checkbox. For more information about using Workflow as Steps click here

Thumbnail

In this mode you are required to choose a scope. The default option is All async workflow executions. You can also select to wait for Executions by specifying an Execution ID(s), or a Step ID(s).

Thumbnail

Thumbnail Note

The Note Action is static text that helps to guide the end-user of a Workflow.

Thumbnail

Thumbnail End Run

The End Run Action enables you to select the final status of an execution, Completed or Failed.

Thumbnail