Scatter Gather can execute multiple tasks in parallel. In this component, you can add multiple branches and configure a subflow in each branch to execute a task independently.
|Parameter||Data Type||Description||Required||Default Value|
|Maximum parallelism||int||Maximum number of tasks executed in parallel. Value range: 2–8. The actual parallelism is the lesser value between the number of branches and the maximum parallelism.||Yes||4|
|Root message||string||The root message is a variable, which stores the
messageinput to the subflow
|payload||This attribute inherits the
|attribute||This attribute inherits the
|variable||This attribute inherits the variable of the main flow.|
The output result of Scatter Gather doesn't contain the
variable variable used in the processing logic but only the data in
payload is of
dict type and aggregates the processing result of each branch.
message output by the component is as detailed below:
|payload||This attribute is of
|attribute||The value is the same as that of the input
|variable||The value is the same as that of the input variable.|
We recommend you use Scatter Gather to execute different tasks in parallel. For example, if you need to query the customer and product information based on the user order data, you can configure two branches to query the two types of information respectively.
payloadis a dictionary containing two keys.
1represents the result of the first branch, i.e., the queried customer information, and key
2represents the result of the second branch, i.e., the queried product information.