law.workflow.local#

Local workflow implementation.

Class LocalWorkflow#

class LocalWorkflow(*args, **kwargs)[source]#

Bases: BaseWorkflow

Local workflow implementation. The workflow type is "local". There are two ways how a local workflow starts its branch tasks. See the local_workflow_require_branches attribute for more information.

Since local workflows trigger their branch tasks via requirements or dynamic dependencies, their run methods do not support decorators. See BaseWorkflow.workflow_run_decorators for more info.

classattribute workflow_proxy_cls#

type: BaseWorkflowProxy

Reference to the LocalWorkflowProxy class.

classattribute local_workflow_require_branches#

type: bool

When True, the workflow will require its branch tasks within LocalWorkflowProxy.requires() so that the execution of the workflow indirectly starts all branch tasks. When False, the workflow uses dynamic dependencies by yielding its branch tasks within its own run method.

workflow_proxy_cls#

alias of LocalWorkflowProxy

Class LocalWorkflowProxy#

class LocalWorkflowProxy(*args, **kwargs)[source]#

Bases: BaseWorkflowProxy

Workflow proxy class for the local workflow implementation. The workflow type is "local".

requires()[source]#

Returns the default workflow requirements in an ordered dictionary, which is updated with the return value of the task’s workflow_requires method.

run()[source]#

When local_workflow_require_branches of the task was set to False, starts all branch tasks via dynamic dependencies by yielding them in a list, or simply does nothing otherwise.