feat: auto-detect custom start and stop events in workflow classes #17865
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
With #17767 we introduced the ability to use custom start and stop events in workflow. I wasn't happy with the UX, because in order to use custom events you had to pass them to the workflow init like this (or a variation of this):
With this PR, start and stop events are inferred from the step definitions, so if your workflow is using
MyStart
andMyStop
, you can intantiate the workflow without caring about that:wf = MyWorkflow()
.Question: the current PR is backward compatible, but
start_event_class
andstop_event_class
were added very recently and not documented. Should we just kill them and always rely on introspection?Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.