Replies: 3 comments
-
Child workflows follow the same execution pattern as activities. Serial Execution: Using multiple yield statements ensures that each child workflow executes only after the previous one completes. return [
yield ChildWorkflowStub::make(MyChildWorkflow1::class),
yield ChildWorkflowStub::make(MyChildWorkflow2::class),
yield ChildWorkflowStub::make(MyChildWorkflow3::class),
]; Here, MyChildWorkflow1 must finish before MyChildWorkflow2 starts, and so on. Parallel Execution: Using return yield ChildWorkflowStub::all([
ChildWorkflowStub::make(MyChildWorkflow1::class),
ChildWorkflowStub::make(MyChildWorkflow2::class),
ChildWorkflowStub::make(MyChildWorkflow3::class),
]); This approach is useful when child workflows don't have dependencies on each other. Since child workflows mirror activity execution, you can mix and match these approaches, just like activities, to balance performance and dependencies. |
Beta Was this translation helpful? Give feedback.
-
Perfect, thank you. I have one more question: how about compensation of parallel child workflow or activities? Because ChildWorkflowStub::all is an array, there is no option to define Thank you for help. |
Beta Was this translation helpful? Give feedback.
-
Saga pattern is only covered inside a workflow boundary. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
is there an option to run Child Workflows in parallel mode, except async? Unfortunately I cannot find anything in documentation.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions