A branch node is a logical control node in DataStudio that routes workflow execution based on conditions. Each branch maps to a condition expression — when the condition evaluates to true, the child nodes attached to that branch run; when it evaluates to false, those child nodes are skipped.
Branch nodes are typically used together with assignment nodes, which pass variable values that branch conditions can evaluate.
Prerequisites
Before you begin, ensure that you have:
-
A workspace running DataWorks Standard Edition or above. For a comparison of editions, see Differences among DataWorks editions
How it works
A branch node routes execution through named outputs. Each branch you define produces an output name. Child nodes depend on the branch node through these output names — not through direct connections. This means:
-
If a branch condition is met, the child node depending on that output runs.
-
If a branch condition is not met, the child node enters the
Not Runningstate. -
If descendant nodes do not meet specific conditions, they are dry run, and the message
It's set condition-skip by taskis displayed. -
If the expression fails to parse at runtime, the entire branch node fails.
A branch node supports up to 50 branches.
Create a branch node
-
Go to the DataStudio page. Log in to the DataWorks console. In the top navigation bar, select the target region. In the left-side navigation pane, choose Data Development and O\&M \> Data Development. Select your workspace from the drop-down list and click Go to Data Development.
-
Create the node. Move the pointer over the
icon and choose Create Node \> General \> Branch Node. Alternatively, find a workflow in the directory, right-click its name, and choose Create Node \> General \> Branch Node. -
In the Create Node dialog box, set the Name and Path parameters, then click Confirm.
-
Define branch conditions. After adding a branch, click Change to modify it or Delete to remove it. Modifying or deleting a branch also updates the related dependencies.
-
On the node configuration tab, go to the Definition section and click Add Branch.
-
In the Branch Definition dialog box, configure the following parameters.

Parameter
Description
Condition
A Python comparison expression that evaluates to
trueorfalse. Use global variables or node context parameters as inputs — for example,${input}==1. Only Python comparison operators are supported.Associated node output
The output name that links this branch to its child nodes. If the condition is met, the child node that depends on this output name runs. If the child node also depends on the output of other nodes, the status of these nodes is also considered. If the condition is not met, the child node enters the
Not Runningstate. Each branch produces a unique output name that appears automatically in the Dependencies section of the Properties tab.Description
A label for this branch. For example:
${input}==1or${input}>2. -
Click OK.
-
-
Configure scheduling properties. Click the Properties tab in the right-side navigation pane to set scheduling properties. The output names defined in step 4 appear automatically in the output name list under the Dependencies section — use them to attach child nodes to the branch node.
Child nodes inherit dry-run properties of the parent node. To avoid unexpected behavior, do not create nodes that depend on their last-cycle instance as branches. For details, see Configure cross-cycle scheduling dependencies. Dependencies established by drawing lines between nodes in the canvas are not recorded on the Properties tab. Specify these dependencies manually.
-
Save and commit the node. If your workspace runs in standard mode, deploy the node to the production environment after committing: click Deploy in the top navigation bar. For details, see Deploy nodes.
-
Click the
icon in the top toolbar to save. -
Click the
icon to commit. -
In the Submit dialog box, fill in the Change description field, then click Confirm.
-
-
View the task in Operation Center. Click Operation Center in the upper-right corner of the node configuration tab to go to Operation Center in the production environment. To view and manage scheduled tasks, see View and manage auto triggered tasks. For an overview of Operation Center, see Operation Center overview.
Example: attach child nodes to a branch node
The following example shows a branch node with two child nodes, Branch_1 and Branch_2, each depending on a different output.
In the workflow below, both child nodes are attached to the branch node.
Branch_1 depends on the output named autotest.fenzhi121902_1.
Branch_2 depends on the output named autotest.fenzhi121902_2.
After committing the branch node and running it in Operation Center, the condition for Branch_1 is met in this example:
-
Branch_1's condition is met. Its child node runs. Select the branch and check the Runtime Log tab to view execution details.
-
Branch_2's condition is not met. Its child node is skipped, and the message
It's set condition-skip by taskis displayed on the Runtime Log tab.
Supported Python comparison operators
Branch conditions support the following Python comparison operators. In the examples below, a = 10 and b = 20.
| Operator | Description | Example |
|---|---|---|
== |
Equal to | (a==b) returns false |
!= |
Not equal to | (a!=b) returns true |
<> |
Not equal to (equivalent to !=) |
(a<>b) returns true |
> |
Greater than | (a>b) returns false |
< |
Less than. The returned result is 1 or 0. 1 indicates true and 0 indicates false. | (a<b) returns true |
>= |
Greater than or equal to | (a>=b) returns false |
<= |
Less than or equal to | (a<=b) returns true |
What's next
-
Configure an assignment node — pass variable values into branch conditions