botify-labs / simpleflow

Python library for dataflow programming.
https://botify-labs.github.com/simpleflow/
MIT License
68 stars 24 forks source link

decider.start: work without workflows #397

Closed ybastide closed 2 years ago

ybastide commented 2 years ago

We currently must call decider.start with a (list of) workflow(s). But we've long known that this list is unneeded; its only use is really filling the DeciderWorker._workflow_executors dict.

A decider can currently instantiate any workflow, as long as its fully qualified class name matches the SWF workflow type: this is how child workflows work. However, our usual SWF workflow type is workflow.type.name (for instance, examples.basic.BasicWorkflow's name is examples.basic.BasicWorkflow.name == "basic").

A solution to accommodate both naming conventions and the need of a FQCN to instantiate an arbitrary class would be passing this optional full name as an extra input when starting a workflow, e.g. in workflow.start.