ParallelBuilder
Class: ParallelBuilder
Defined in: src/core-flow/Parallel.ts:790
Fluent builder. Requires at least 2 branches + one merge strategy.
Constructors
Constructor
new ParallelBuilder(
opts):ParallelBuilder
Defined in: src/core-flow/Parallel.ts:796
Parameters
opts
Returns
ParallelBuilder
Methods
branch()
branch(
id,runner,nameOrOpts?):this
Defined in: src/core-flow/Parallel.ts:809
Add a branch. All branches run concurrently with the same input.
Third arg accepts EITHER a legacy bare name string (back-compat
with pre-L1c callers) OR a ParallelBranchOptions bag containing
name and/or a per-method groupTranslator override. The
override applies ONLY to this branch's member.uiGroup and does
not affect any other branch or the runner's own translator.
Parameters
id
string
runner
BranchChild
nameOrOpts?
string | ParallelBranchOptions
Returns
this
build()
build():
Parallel
Defined in: src/core-flow/Parallel.ts:880
Returns
mergeOutcomesWithFn()
mergeOutcomesWithFn(
fn):this
Defined in: src/core-flow/Parallel.ts:872
Tolerant merge — receives { [branchId]: BranchOutcome } including
both successes ({ ok: true, value }) and failures ({ ok: false, error }).
Parallel does NOT throw on partial failure when this merge variant is
used; the consumer's fn decides how to handle it (fall back, surface
a warning, retry at a higher level, etc.).
Use the default mergeWithFn / mergeWithLLM variants when you want
a single failing branch to abort the whole Parallel loudly.
Parameters
fn
Returns
this
mergeWithFn()
mergeWithFn(
fn):this
Defined in: src/core-flow/Parallel.ts:845
Merge branch results via a pure function.
fn receives { [branchId]: string } and returns the merged string.
Parameters
fn
Returns
this
mergeWithLLM()
mergeWithLLM(
opts):this
Defined in: src/core-flow/Parallel.ts:854
Merge branch results by feeding them to an LLM for synthesis.
Parameters
opts
Returns
this
