-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Added support for executing a sub-workflow #1363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
danielgerlag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to merge this if we can revert the WaitFor primitive changes.
| } | ||
|
|
||
| return ExecutionResult.WaitForEvent(EventName, EventKey, effectiveDate); | ||
| var eventKey = context.Workflow.Reference ?? EventKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not make sense, why would we default to the reference field as the wait key? This could be a major breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should be changing the behaviour of the WaitFor primitive to support this feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielgerlag thanks for pointing that out. The parent workflow must wait for sub workflow to finish and I thought the sub workflow can publish an event containing the parent reference.
My question is how can I propagate the parent workflow id to sub workflow? Should I save it as sub workflow data?
Describe the change
This PR adds a support to run a sub-workflow from the main workflow.
Describe your implementation or design
New step builder was added to support sub-workflow. The step starts a new workflow when executed with given workflow id (name). The workflow gets an reference to main workflow, the main workflow then waits for a workflow completed event triggered from the sub-workflow and continues.
If sub-event expects an event then the event should be published with parent workflow id since the sub-workflow id is not known.
An error in the sub-workflow terminates it and consequently terminates the parent workflow as well.
Tests
Yes
Breaking change
EndWorflowwill raise theWorkflowCompletedevent (which will probably solve If using EndWorkflow() no event for WorkflowCompleted LifeCycleEvent #1353)ExecutionErrortable