Control Flow Steps
Steps for conditional branching, loops, error handling, and flow control.
Control Flow Steps
Control flow steps determine the execution path of your flow -- branching, looping, and handling errors.
If/Else
Executes one branch if a condition is true, and optionally another if it is false.
The If/Else step creates two branches on the canvas: a True branch and a False branch. Place subsequent steps inside either branch.
Condition: vars.user != null && vars.user.role == 'admin'
Switch
Multi-way branching based on the value of an expression. Each case defines a value to match and a branch of steps to execute.
Expression: params.action Cases: ['create', 'update', 'delete'] Default: true
Loop
Iterates over an array or a numeric range, executing the contained steps for each iteration.
Iterable: vars.products Item Variable: product Index Variable: i
Inside the loop body, access vars.product and vars.i.
For Each
A simplified loop that iterates over an array. Functionally similar to Loop but optimized for common array iteration.
Array: vars.orderItems Item Variable: orderItem
While
Repeats the contained steps as long as a condition remains true.
Condition: vars.retryCount < 3 && vars.success == false
Be careful with While loops. If the condition never becomes false, the flow will run indefinitely. Always include logic inside the loop that eventually changes the condition.
Try/Catch
Wraps steps in error handling. If any step in the Try block throws an error, execution jumps to the Catch block.
The Try/Catch step creates two branches: a Try branch for the main logic and a Catch branch for error handling.
Error Variable: err
Inside the Catch branch, access vars.err.message and vars.err.stack.
Break
Exits the current loop immediately. Only valid inside Loop, For Each, or While steps.
Break has no configurable properties. Drag it into a loop body and it will stop iteration when reached.
Continue
Skips the remainder of the current loop iteration and proceeds to the next one. Only valid inside Loop, For Each, or While steps.
Continue has no configurable properties. Place it inside a conditional branch within a loop to skip specific iterations.
Throw Error
Throws an error with a custom message. If inside a Try/Catch block, the error is caught. Otherwise, the flow terminates with an error response.
Message: 'User not found' Status Code: 404
A boolean expression to evaluate. The value to match against each case. List of case values. Each case creates a branch on the canvas. Whether to include a default branch for unmatched values. An array expression or range to iterate over. Variable name for the current item. Defaults to `item`. Variable name for the current index. Defaults to `index`. The array to iterate over. Variable name for the current item. A boolean expression evaluated before each iteration. Variable name to store the caught error object. Defaults to `error`. The error message. HTTP status code to return if the error is unhandled. Defaults to 500. Steps Reference /reference/steps Browse all step categories Variable Steps /reference/steps/variables Set variables and return values Operators /reference/operators Operators for conditions and expressions