class documentation
class WorkflowInstance(ABC): (source)
Known subclasses: temporalio.worker._workflow_instance._WorkflowInstanceImpl
, temporalio.worker.workflow_sandbox._runner._Instance
Instance of a workflow that can handle activations.
Method | activate |
Handle an activation and return completion. |
Method | get |
Return appropriate serialization context. |
Method | get |
Return the thread identifier that this workflow is running on. |
@abstractmethod
def activate(self, act:
def activate(self, act:
temporalio.bridge.proto.workflow_activation.WorkflowActivation
) -> temporalio.bridge.proto.workflow_completion.WorkflowActivationCompletion
:
(source)
¶
overridden in
temporalio.worker._workflow_instance._WorkflowInstanceImpl
, temporalio.worker.workflow_sandbox._runner._Instance
Handle an activation and return completion.
This should never raise an exception, but instead catch all exceptions and set as completion failure.
Parameters | |
act:temporalio.bridge.proto.workflow_activation.WorkflowActivation | Protobuf activation. |
Returns | |
temporalio.bridge.proto.workflow_completion.WorkflowActivationCompletion | Completion object with successful commands set or failure info set. |
@abstractmethod
def get_serialization_context(self, command_info:
def get_serialization_context(self, command_info:
_command_aware_visitor.CommandInfo | None
) -> temporalio.converter.SerializationContext | None
:
(source)
¶
overridden in
temporalio.worker._workflow_instance._WorkflowInstanceImpl
, temporalio.worker.workflow_sandbox._runner._Instance
Return appropriate serialization context.
Parameters | |
command_command_aware_visitor.CommandInfo | None | Optional information identifying the associated command. If set, the payload codec will have serialization context set appropriately for that command. |
Returns | |
temporalio.converter.SerializationContext | None | The serialization context, or None if no context should be set. |