Nous.Workflow.Engine.StateMerger (nous v0.15.5)
View SourceMerge strategies for combining parallel branch results back into workflow state.
After parallel branches complete, their results need to be merged into a single state. Three built-in strategies are provided:
:deep_merge— deep-merges all branch result maps intostate.data:list_collect— collects branch results into a list under a key- Custom function —
fn branch_results, state -> updated_state
Summary
Functions
Merge parallel branch results into the workflow state.
Types
@type strategy() :: :deep_merge | :list_collect | (list(), Nous.Workflow.State.t() -> Nous.Workflow.State.t())
Functions
@spec merge([{String.t(), term()}], Nous.Workflow.State.t(), strategy(), keyword()) :: Nous.Workflow.State.t()
Merge parallel branch results into the workflow state.
Parameters
results— list of{branch_id, result}tuples from completed branchesstate— current workflow statestrategy— merge strategy atom or custom functionopts— additional options (:result_keyfor:list_collect)