Skip to content

Interface: FlowSubBranchBuilder<TFlowIn, TBranchOut, THandle, TReceipt, TCustomMetrics, TStepOutputs> ​

Defined in: builders/flow-sub-branch-builder.ts:24

Fluent sub-builder passed to FlowBranchBuilder.when(...) and FlowBranchBuilder.otherwise(...).

Appends sequential steps inside a conditional branch case and threads accumulated step output types across .step(...) calls.

Type Parameters ​

Type ParameterDefault typeDescription
TFlowInunknownEnclosing flow input payload type.
TBranchOutunknownUnified branch output payload type.
THandleunknownIsolation scope handle type.
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.

Methods ​

step() ​

ts
step<TStepId, TStep>(
   id, 
   step, 
   configure?
): FlowSubBranchBuilder<TFlowIn, TBranchOut, THandle, TReceipt, TCustomMetrics, TStepOutputs & { readonly [K in string]: ExtractStepOutput<TStep> }>;

Defined in: builders/flow-sub-branch-builder.ts:51

Appends a sequential step inside this branch case.

Records the step's output type under TStepOutputs[TStepId] for subsequent steps in the same sub-branch.

Type Parameters ​

Type ParameterDescription
TStepId extends stringLiteral step identifier string.
TStep extends StepASTNodeStep AST node type.

Parameters ​

ParameterTypeDescription
idTStepIdUnique step identifier.
stepMaybeBuilder<TStep>Step AST node or builder.
configure?($s) => FlowStepConfigBuilder<TFlowIn, ExtractStepInput<TStep>, THandle, TReceipt, TCustomMetrics, TStepOutputs, TStepId>Optional step input and interrupt configurator.

Returns ​

FlowSubBranchBuilder<TFlowIn, TBranchOut, THandle, TReceipt, TCustomMetrics, TStepOutputs & { readonly [K in string]: ExtractStepOutput<TStep> }>

New immutable sub-branch builder.

Properties ​

PropertyModifierTypeDescriptionDefined in
stepsreadonlyreadonly ( | FlowStepNode<unknown, unknown, THandle, string> | FlowBranchNode<unknown, unknown, THandle, string>)[]Ordered sequence of steps or nested branches inside this sub-branch.builders/flow-sub-branch-builder.ts:33

Released under the MIT License.