workflows.services.executors.factory

Factory and base types for workflow step executors.

Classes

AbstractStepExecutor

Base class for all step executors.

StepExecutorFactory

Registry-backed factory for step executors.

Module Contents

class workflows.services.executors.factory.AbstractStepExecutor[source]

Base class for all step executors.

execute(instance, signal)[source]

Execute this step.

Parameters:
Returns:

The result of executing the step.

Return type:

workflows.services.types.ExecutorResult

do_execute(instance, signal)[source]

Actual execution hook implemented by concrete executors.

Parameters:
Returns:

The result of executing the step.

Raises:

NotImplementedError – Always; subclasses must implement.

Return type:

workflows.services.types.ExecutorResult

class workflows.services.executors.factory.StepExecutorFactory[source]

Registry-backed factory for step executors.

_registry: ClassVar[dict[str, type[AbstractStepExecutor]]][source]
classmethod register(step_type, executor_cls)[source]

Register an executor class for a step type.

Parameters:
  • step_type (str) – Identifier of the step type.

  • executor_cls (type[AbstractStepExecutor]) – Concrete executor class to instantiate for this type.

Return type:

None

classmethod create(step_type)[source]

Create an executor for the given step type.

Parameters:

step_type (str) – Identifier of the step type.

Returns:

An instance of the registered executor class.

Raises:

ValueError – If no executor is registered for step_type.

Return type:

AbstractStepExecutor

classmethod registered_types()[source]

Return the set of registered step type identifiers.

Return type:

set[str]