Skip to main content

Fusion

Merges results from multiple parallel branches into a single flow. Waits for all branches to complete before continuing.

Common parameters

ParameterTypeRequiredVariableDescription
mergeStrategychoice (all, first, last, race, concat, zip)YesNoStrategy for merging parallel branches. (Default: "all")
branchCountnumberYesNoNumber of input branches to merge. (Default: 2, min 2, max 8)
outputVariabletextNoNoOutput variable name containing the merged result.

Parameters by strategy

all — All

Waits for all branches to complete before continuing.

ParameterTypeRequiredVariableDescription
waitForAllbooleanNoNoBlock until all branches have completed. (Default: true)

first — First

Returns the result of the first completed branch.

last — Last

Returns the result of the last completed branch.

race — Race

The first branch to finish wins. Others are discarded.

ParameterTypeRequiredVariableDescription
raceTimeoutnumberNoNoTimeout in milliseconds. Error if no branch completes in time. 0 or empty = no timeout. (min 0, max 60000)

concat — Concat

Concatenates arrays from each branch into a single array.

ParameterTypeRequiredVariableDescription
orderchoice (sequential, completion)NoNoConcatenation order: sequential (branch order) or by completion order. (Default: "sequential")

zip — Zip

Combines results element-by-element, like zipping arrays together.

ParameterTypeRequiredVariableDescription
zipModechoice (shortest, longest)NoNoZip mode: stop at the shortest array, or fill missing values. (Default: "shortest")
fillValuedynamic valueNoYesFill value for 'longest' mode when an array is shorter.

Parameters marked Variable = Yes accept the {{blockName.field}} syntax.

Output

Output variable : mergedData

{
"branches": []
}

Example

Merge results from two branches.

Input :

{}

Output :

{"branches": [{"branchId": "branch-1", "data": {"score": 85}}, {"branchId": "branch-2", "data": {"score": 92}}]}
Tip

{{mergedData.branches}} is an array containing each branch result. Use a Transform block after the merge to restructure the data.