Skip to content

workflow.branch

Operation: workflow.branch
Category: workflow
Tags: control-flow

Evaluate a condition and select a branch (then/else)

Type: Native (built-in)
Timeout: 300s
Retries: 3 (ExponentialWithJitter)

NameTypeRequiredDefaultDescription
condition_pathStringNo"$context.condition"Context path to evaluate (e.g., $context.score)
NameTypeDescription
branchStringSelected branch name
condition_metBooleanWhether the condition was true
operatorStringOperator used
{
"else_branch": "else",
"operator": "exists",
"then_branch": "then"
}
import { WorkflowBuilder } from "@fabric-platform/sdk";
const workflow = new WorkflowBuilder("my-workflow")
.node("workflow-branch", "transform", (n) =>
n.config({
operation: "workflow.branch",
// ... node-specific config
})
)
.build();
{
"key": "check-approval",
"operation": "workflow.branch",
"config": {
"condition_path": "$context.approval.approved",
"operator": "eq",
"value": true,
"then_branch": "publish",
"else_branch": "revise"
},
"outputs": [{ "name": "branch", "path": "$context.selected_branch" }]
}

Condition path resolved to null — defaulting to else branch

Section titled “Condition path resolved to null — defaulting to else branch”

Cause: The context path specified in condition_path does not exist

Fix: Ensure the upstream node produces output at the path you’re checking. Use workflow.validate_context before branching to catch this earlier