All Products
Search
Document Center

Data Management:Configure a conditional branch node

Last Updated:Jun 21, 2026

To add conditional logic to a task flow, add a conditional branch node. This node executes subsequent tasks only when specific conditions are met. This topic describes how to configure a conditional branch node.

Use cases

When a task flow runs, the conditional branch node evaluates its conditional expression. If the result is true, subsequent tasks are executed. Otherwise, they are not executed. Common use cases for conditional branch nodes include the following:

  • Backing up and deleting data after the number of data entries reaches a certain threshold.

  • Sending a notification after a sales target is met.

  • Checking if a file exists. If the file does not exist, create a new one.

Usage notes

To function correctly, the node must be connected to a data integration, data processing, or status check node.

Configure a conditional branch node

  1. Log in to DMS 5.0.

  2. In the top navigation bar, choose Data+AI > Data+AI > Task Orchestration.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All Features > Data+AI > Data Development > Task Orchestration.

  3. Click the name of the target task flow to open its details page.

    Note

    If you need to create a new task flow, see Create a task flow.

  4. From the Task Type list on the left of the canvas, drag the Conditional Branch node to a blank area on the canvas.

  5. Double-click the Conditional Branch node.

  6. On the node's configuration page, set the conditional expression.

    • From the variable name drop-down list, select Upstream Variables or Statuses.

      Note
      • The Variable Setting tab lists the available upstream variables and run statuses under Input Variables.

      • If you select Run Status as the variable name, you do not need to configure the relational operator and variable value.

    • From the Relational Operator drop-down list, select an operator.

    • In the Variable Value field, enter a value or variable.

      The input format for a variable is ${var_name}. You can enter one of the following three types of variables:

      • Upstream variable: An output variable from an upstream node. Available upstream variables are listed on the Variable Setting tab under Input Variables.

      • System variable: Available system variables are listed on the Variable Setting tab under Input Variables. For more information, see System variables.

      • Time variable: Use a default system time variable or a task flow variable. To set a task flow variable, see Configure time variables.

    • Optional: Click the buttons to the right of a conditional expression to add or delete expressions.

      • 加: Adds a conditional expression at the same level as the original one. Select a logical operator from the drop-down list to define the relationship between the new and original expressions.

      • 5加4: Adds a conditional expression and nests both the new and original expressions one level deeper. Select a logical operator to define the relationship between them.

      • 减: Deletes the conditional expression.

      For example, a multi-line conditional expression consists of rows, where each row contains a variable name, a relational operator, and a variable value, such as Consumption > 80 or All Succeeded == true. Multiple conditions are connected by logical operators such as || (OR) and && (AND) to form a composite expression.

    Note
    • You can nest conditional expressions up to three levels deep.

    • Preview the expression's logic in the Preview area on the right.

    • Expressions in a conditional branch node can use output variables from an sql assignment node and an ECS remote commands node.

Examples

AND relationship

If the branches in a task flow have an AND relationship, DMS marks the entire task flow as Failed if any branch does not run, even if other branches succeed.

Example of a conditional branch with an AND relationship:

The start node, sql assignment node-1, forks into two branches, Conditional Branch-1 and Conditional Branch-2. These branches connect to the Single-instance SQL-1 and Single-instance SQL-2 nodes, respectively.

The overall status of the task flow instance is Failed. In the task list, the status of Single-instance SQL-1 is Canceled, while the statuses of Single-instance SQL-2 and sql assignment node-1 are Succeeded. The statuses for Conditional Branch-1 and Conditional Branch-2 are - (not executed).

OR relationship

If the branches in a task flow have an OR relationship, the task flow is marked as Succeeded if the nodes on any single path execute successfully, even if nodes on other paths fail.

Example of a conditional branch with an OR relationship:

image

In a conditional branch node within the task flow (for example, Conditional Branch-3), configure a conditional expression that always evaluates to true, such as RunSucceeded == true. If any branch executes successfully, the entire task flow is marked as Succeeded.

The task flow execution result is Succeeded.

The final statuses are as follows: Single-instance SQL-1 is Canceled; Single-instance SQL-2 (duration: 10,365 ms), Single-instance SQL-3 (duration: 11,120 ms), and sql assignment node-1 (duration: 896 ms) are Succeeded; and the Conditional Branch-1, Conditional Branch-2, and Conditional Branch-3 nodes were not executed (status: -). As a result, the overall task flow is marked as Succeeded.

Other operations

Expressions in a conditional branch node can use output variables from an sql assignment node and an ECS remote commands node.