A branch node is a logical control node in DataStudio. It can define the branch logic and the direction of branches under different logical conditions.
Prerequisites
- DataWorks Standard Edition or a more advanced edition is activated. Then, you can use branch nodes.
- Generally, branch nodes need to be used together with assignment nodes. For more information, see Configure an assignment node.
Create a branch node
Example: Configure child nodes for a branch node
You can associate child nodes with different outputs of a branch node to define the
branches under different conditions. For example, in the workflow that is shown in
the following figure, the branches Branch_1 and Branch_2 are defined as the child nodes of the branch node.

Branch_1 depends on the output that is named autotest.fenzhi121902_1.

Branch_2 depends on the output that is named autotest.fenzhi121902_2.

Commit the branch node and run it in Operation Center. In this example, the condition
of Branch_1 is met. Branch_1 depends on the autotest.fenzhi121902_1 output of the branch node. The following figures show the operational logs.
- The condition of Branch_1 is met. The child node of this branch is run. You can select the branch and view the running details of the child node on the Runtime Log tab.
- The condition of Branch_2 is not met. The child node of this branch is skipped. You can select the branch and view relevant information on the Runtime Log tab.
Supported Python comparison operators
Assume that the value of Variable a is 10 and that of Variable b is 20 in the following
table.
Operator | Description | Example |
---|---|---|
== | Equal: checks whether two objects are equal. | (a==b) returns false. |
! = | Not equal: checks whether two objects are not equal. | (a!=b) returns true. |
<> | Not equal: checks whether two objects are not equal. | (a<>b) returns true. This operator is similar to !=. |
> | Greater than: checks whether x is greater than y. | (a>b) returns false. |
< | Less than: checks whether x is less than y. If the returned result is 1 or 0, 1 indicates true and 0 indicates false. The results 1 and 0 are equivalent to the special variables true and false. | (a<b) returns true. |
>= | Greater than or equal to: checks whether x is greater than or equal to y. | (a>=b) returns false. |
<= | Less than or equal to: checks whether x is less than or equal to y. | (a<=b) returns true. |