Add conditions to a pipeline to handle various scenarios.
Configuring conditions for the pipeline
As you create a pipeline, you can specify conditions that must be met before you run the pipeline. For example, you can set a condition that the output from a node must satisfy a particular condition before proceeding with the pipeline execution.
To define a condition:
-
Hover over the link between two nodes.
-
Click Add condition.
-
Choose the type of condition:
- Condition Response checks a condition on the status of the previous node.
- Simple condition is a no-code condition in the form of an if-then statement.
- Advanced condition Advanced condition uses expression code, providing the most features and flexibility.
-
Define and save your expression.
When you define your expression, a summary captures the condition and the expected result. For example:
If Run AutoAI is Successful, then Create deployment node.
When you return to the flow, you see an indicator that you have successfully defined a condition. Hover over the icon to edit or delete the condition.
Configuring a condition based on node status
If you select Condition Response as your condition type, the previous node status must satisfy at least one of these conditions to continue with the flow:
- Completed - the node activity completed without error.
- Completed with warnings - the node activity completed but with warnings.
- Completed with errors - the node activity completed, but with errors.
- Failed - the node activity failed to complete.
- Cancelled - the previous action or activity was canceled.
Configuring a simple condition
To configure a simple condition, choose the condition that must be satisfied to continue with the flow.
- Optional: edit the default name.
- Depending on the node, choose a variable from the drop-down options. For example, if you are creating a condition based on a Run AutoAI node, you can choose Model metric as the variable to base your condition on.
- Based on the variable, choose an operator from: Equal to, Not equal to, Greater than, Less than, Greater than or equal to, Less than or equal to.
- Specify the required value. For example, if you are basing a condition on an AutoAI metric, specify a list of values consisting of available metrics.
- Optional: click the plus icon to add an And (all conditions must be met) or an Or (either condition must be met) to the expression to build a compound conditional statement.
- Review the summary and save the condition.
Configuring an advanced condition
Use coding constructs to build a more complex condition. The next node executes when the condition is met. You build the advanced condition by using the expression builder.
- Optional: edit the default name.
- Add items from the Expression elements panel to the Expression canvas to build your condition. You can also type your conditions and the elements autocomplete.
- When your expression is complete, review the summary and save the condition.
Learn more
For details on using the code editor to build an expression, see:
Parent topic: Creating a pipeline