0 / 0
Adding conditions to the pipeline

Adding conditions to the pipeline

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 you proceed with the pipeline execution.

To define a condition:

  1. Hover over the link between two nodes.

  2. Click Add condition.

  3. Choose the type of condition:

  4. Define and save your expression.

Defining a condition

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 defined a condition. Hover over the icon to edit or delete the condition.

Viewing a successful 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 is completed without error.
  • Completed with warnings - the node activity is completed but with warnings.
  • Completed with errors - the node activity is 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.

  1. Optional: edit the default name.
  2. 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.
  3. 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.
  4. Specify the required value. For example, if you are basing a condition on an AutoAI metric, specify a list of values that consists of the available metrics.
  5. 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.
  6. Review the summary and save the condition.

Configuring an advanced condition

Use coding constructs to build a more complex condition. The next node runs when the condition is met. You build the advanced condition by using the expression builder.

  1. Optional: edit the default name.
  2. 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.
  3. When your expression is complete, review the summary and save the condition.

Learn more

For more information on using the code editor to build an expression, see:

Parent topic: Creating a pipeline

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more