Skip to content

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 ParameterDefault typeDescription
TInunknownValidated flow input payload type.
THandleunknownRuntime handle type of the active isolation scope.

Parameters ​

ParameterTypeDescription
flowCtxFlowExecutionContext<TIn, THandle>Active flow execution context.
branchNodeFlowBranchNode<TIn, unknown, THandle>Passive FlowBranchNode to evaluate.

Returns ​

Promise<{ output?: unknown; status: "completed" | "suspended" | "rewound"; }>

Branch execution outcome.

Released under the MIT License.