class documentation
class WorkflowRunner(ABC): (source)
Known subclasses: temporalio.worker.UnsandboxedWorkflowRunner
, temporalio.worker.workflow_sandbox.SandboxedWorkflowRunner
Abstract runner for workflows that creates workflow instances to run.
UnsandboxedWorkflowRunner
is an implementation that locally runs
the workflow.
Method | create |
Create a workflow instance that can handle activations. |
Method | prepare |
Prepare a workflow for future execution. |
Method | set |
Set worker-level failure exception types that will be used to validate in the sandbox when calling prepare_workflow. |
@abstractmethod
def create_instance(self, det:
def create_instance(self, det:
WorkflowInstanceDetails
) -> WorkflowInstance
:
(source)
¶
overridden in
temporalio.worker.UnsandboxedWorkflowRunner
, temporalio.worker.workflow_sandbox.SandboxedWorkflowRunner
Create a workflow instance that can handle activations.
Parameters | |
det:WorkflowInstanceDetails | Details that can be used to create the instance. |
Returns | |
WorkflowInstance | Workflow instance that can handle activations. |
overridden in
temporalio.worker.UnsandboxedWorkflowRunner
, temporalio.worker.workflow_sandbox.SandboxedWorkflowRunner
Prepare a workflow for future execution.
This is run once for each workflow definition when a worker starts. This allows the runner to do anything necessarily to prepare for this definition to be used multiple times in create_instance.
Parameters | |
defn:temporalio.workflow._Definition | The workflow definition. |
def set_worker_level_failure_exception_types(self, types:
Sequence[ Type[ BaseException]]
):
(source)
¶
Set worker-level failure exception types that will be used to validate in the sandbox when calling prepare_workflow.
Parameters | |
types:Sequence[ | Exception types. |