Function: executeFlowBranch()
ts
function executeFlowBranch<TIn, THandle>(flowCtx, branchNode): Promise<{
output?: unknown;
status: "completed" | "suspended" | "rewound";
}>;Defined in: runtime/flow/internal/execute-flow-branch.ts:18
Evaluates a FlowBranchNode against flowCtx.currentInput, executes the first matching when case (or otherwiseSteps), and records output under branchNode.id (SPEC.md §3.9).
Validates the final step output of the selected branch against branchNode.outputSchema.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TIn | unknown | Validated flow input payload type. |
THandle | unknown | Runtime handle type of the active isolation scope. |
Parameters
| Parameter | Type | Description |
|---|---|---|
flowCtx | FlowExecutionContext<TIn, THandle> | Active flow execution context. |
branchNode | FlowBranchNode<TIn, unknown, THandle> | Passive FlowBranchNode to evaluate. |
Returns
Promise<{ output?: unknown; status: "completed" | "suspended" | "rewound"; }>
Branch execution outcome.