class documentation

Instance of a workflow that can handle activations.

Method activate Handle an activation and return completion.
Method get_serialization_context Return appropriate serialization context.
Method get_thread_id Return the thread identifier that this workflow is running on.

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.WorkflowActivationProtobuf activation.
Returns
temporalio.bridge.proto.workflow_completion.WorkflowActivationCompletionCompletion object with successful commands set or failure info set.
@abstractmethod
def get_serialization_context(self, command_info: _command_aware_visitor.CommandInfo | None) -> temporalio.converter.SerializationContext | None: (source)

Return appropriate serialization context.

Parameters
command_info:_command_aware_visitor.CommandInfo | NoneOptional information identifying the associated command. If set, the payload codec will have serialization context set appropriately for that command.
Returns
temporalio.converter.SerializationContext | NoneThe serialization context, or None if no context should be set.
def get_thread_id(self) -> int | None: (source)

Return the thread identifier that this workflow is running on.

Not an abstractmethod because it is not mandatory to implement. Used primarily for getting the frames of a deadlocked thread.

Returns
int | NoneThread ID if the workflow is running, None if not.