Skip to content

Function: createFlowBranchBuilder() ​

ts
function createFlowBranchBuilder<TFlowIn, TBranchOut, THandle, TBranchId, TReceipt, TCustomMetrics, TStepOutputs>(id): FlowBranchBuilder<TFlowIn, TBranchOut, THandle, TBranchId, TReceipt, TCustomMetrics, TStepOutputs>;

Defined in: builders/create-flow-branch-builder.ts:23

Creates a fluent FlowBranchBuilder for flow.branch(id, $b => ...).

Validates that id is a non-empty branch identifier and initializes an immutable FlowBranchBuilder with empty .when() cases and .otherwise() fallback steps.

Type Parameters ​

Type ParameterDefault typeDescription
TFlowInunknownEnclosing flow input payload type.
TBranchOutunknownUnified branch output payload type.
THandleunknownIsolation scope handle type.
TBranchId extends stringstringLiteral branch step identifier string.
TReceiptunknownInspected scope receipt type.
TCustomMetrics extends Record<string, unknown>Record<string, unknown>Custom step telemetry metrics type.
TStepOutputs extends Record<string, unknown>Record<string, never>Accumulated step outputs map type.

Parameters ​

ParameterTypeDescription
idTBranchIdUnique identifier of the branch node.

Returns ​

FlowBranchBuilder<TFlowIn, TBranchOut, THandle, TBranchId, TReceipt, TCustomMetrics, TStepOutputs>

Frozen branch builder.

Released under the MIT License.