class documentation

Undocumented

Method __init__ Undocumented
Method activate Handle an activation and return completion.
Method call_at Undocumented
Method call_exception_handler Undocumented
Method call_later Undocumented
Method call_soon Undocumented
Method create_future Undocumented
Method create_task Undocumented
Method default_exception_handler Undocumented
Method get_debug Undocumented
Method get_exception_handler Undocumented
Method get_thread_id Return the thread identifier that this workflow is running on.
Method set_exception_handler Undocumented
Method time Undocumented
Method workflow_all_handlers_finished Undocumented
Method workflow_continue_as_new Undocumented
Method workflow_extern_functions Undocumented
Method workflow_get_current_build_id Undocumented
Method workflow_get_current_details Undocumented
Method workflow_get_current_history_length Undocumented
Method workflow_get_current_history_size Undocumented
Method workflow_get_external_workflow_handle Undocumented
Method workflow_get_query_handler Undocumented
Method workflow_get_signal_handler Undocumented
Method workflow_get_update_handler Undocumented
Method workflow_get_update_validator Undocumented
Method workflow_info Undocumented
Method workflow_is_continue_as_new_suggested Undocumented
Method workflow_is_replaying Undocumented
Method workflow_memo Undocumented
Method workflow_memo_value Undocumented
Method workflow_metric_meter Undocumented
Method workflow_patch Undocumented
Method workflow_payload_converter Undocumented
Method workflow_random Undocumented
Method workflow_set_current_details Undocumented
Method workflow_set_query_handler Undocumented
Method workflow_set_signal_handler Undocumented
Method workflow_set_update_handler Undocumented
Async Method workflow_sleep Undocumented
Method workflow_start_activity Undocumented
Async Method workflow_start_child_workflow Undocumented
Method workflow_start_local_activity Undocumented
Method workflow_time_ns Undocumented
Method workflow_upsert_search_attributes Undocumented
Async Method workflow_wait_condition Undocumented
Method _add_command Undocumented
Method _apply Undocumented
Method _apply_cancel_workflow Undocumented
Method _apply_do_update Undocumented
Method _apply_fire_timer Undocumented
Method _apply_initialize_workflow Undocumented
Method _apply_notify_has_patch Undocumented
Method _apply_query_workflow Undocumented
Method _apply_remove_from_cache Undocumented
Method _apply_resolve_activity Undocumented
Method _apply_resolve_child_workflow_execution Undocumented
Method _apply_resolve_child_workflow_execution_start Undocumented
Method _apply_resolve_request_cancel_external_workflow Undocumented
Method _apply_resolve_signal_external_workflow Undocumented
Method _apply_signal_workflow Undocumented
Method _apply_update_random_seed Undocumented
Method _as_read_only Undocumented
Method _assert_not_read_only Undocumented
Async Method _cancel_external_workflow Undocumented
Method _check_condition Undocumented
Method _convert_payloads Undocumented
Method _enhanced_stack_trace Undocumented
Method _instantiate_workflow_object Undocumented
Method _is_workflow_failure_exception Undocumented
Method _make_workflow_input Undocumented
Method _next_seq Undocumented
Method _outbound_continue_as_new Undocumented
Method _outbound_schedule_activity Undocumented
Async Method _outbound_signal_child_workflow Undocumented
Async Method _outbound_signal_external_workflow Undocumented
Async Method _outbound_start_child_workflow Undocumented
Method _process_handler_args Undocumented
Method _process_signal_job Undocumented
Method _register_task Undocumented
Method _run_once Undocumented
Async Method _run_top_level_workflow_function Undocumented
Method _set_workflow_failure Undocumented
Async Method _signal_external_workflow Undocumented
Method _stack_trace Undocumented
Method _temporal_workflow_metadata Undocumented
Method _timer_handle_cancelled Undocumented
Method _timer_impl Undocumented
Method _warn_if_unfinished_handlers Undocumented
Instance Variable _buffered_signals Undocumented
Instance Variable _cancel_requested Undocumented
Instance Variable _conditions Undocumented
Instance Variable _continue_as_new_suggested Undocumented
Instance Variable _curr_seqs Undocumented
Instance Variable _current_activation_error Undocumented
Instance Variable _current_build_id Undocumented
Instance Variable _current_completion Undocumented
Instance Variable _current_details Undocumented
Instance Variable _current_history_length Undocumented
Instance Variable _current_history_size Undocumented
Instance Variable _current_thread_id Undocumented
Instance Variable _defn Undocumented
Instance Variable _deleting Undocumented
Instance Variable _disable_eager_activity_execution Undocumented
Instance Variable _exception_handler Undocumented
Instance Variable _extern_functions Undocumented
Instance Variable _failure_converter Undocumented
Instance Variable _handled_signals_seq Undocumented
Instance Variable _in_progress_signals Undocumented
Instance Variable _in_progress_updates Undocumented
Instance Variable _inbound Undocumented
Instance Variable _info Undocumented
Instance Variable _is_replaying Undocumented
Instance Variable _memo Undocumented
Instance Variable _metric_meter Undocumented
Instance Variable _object Undocumented
Instance Variable _outbound Undocumented
Instance Variable _patches_memoized Undocumented
Instance Variable _patches_notified Undocumented
Instance Variable _payload_converter Undocumented
Instance Variable _pending_activities Undocumented
Instance Variable _pending_child_workflows Undocumented
Instance Variable _pending_external_cancels Undocumented
Instance Variable _pending_external_signals Undocumented
Instance Variable _pending_timers Undocumented
Instance Variable _primary_task Undocumented
Instance Variable _queries Undocumented
Instance Variable _random Undocumented
Instance Variable _read_only Undocumented
Instance Variable _ready Undocumented
Instance Variable _signals Undocumented
Instance Variable _tasks Undocumented
Instance Variable _time_ns Undocumented
Instance Variable _updates Undocumented
Instance Variable _worker_level_failure_exception_types Undocumented
Instance Variable _workflow_input Undocumented

Inherited from _Runtime (via WorkflowInstance):

Static Method current Undocumented
Static Method maybe_current Undocumented
Static Method set_on_loop Undocumented
Property logger_details Undocumented
Instance Variable _logger_details Undocumented

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.
def call_at(self, when: float, callback: Callable[..., Any], *args: Any, context: contextvars.Context | None = None) -> asyncio.TimerHandle: (source)

Undocumented

def call_exception_handler(self, context: _Context): (source)

Undocumented

def call_later(self, delay: float, callback: Callable[..., Any], *args: Any, context: contextvars.Context | None = None) -> asyncio.TimerHandle: (source)

Undocumented

def call_soon(self, callback: Callable[..., Any], *args: Any, context: contextvars.Context | None = None) -> asyncio.Handle: (source)

Undocumented

def create_future(self) -> asyncio.Future[Any]: (source)

Undocumented

def create_task(self, coro: Awaitable[_T] | Generator[Any, None, _T], *, name: str | None = None, context: contextvars.Context | None = None) -> asyncio.Task[_T]: (source)

Undocumented

def default_exception_handler(self, context: _Context): (source)

Undocumented

def get_debug(self) -> bool: (source)

Undocumented

def get_exception_handler(self) -> _ExceptionHandler | None: (source)

Undocumented

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.
def set_exception_handler(self, handler: _ExceptionHandler | None): (source)

Undocumented

def time(self) -> float: (source)

Undocumented

def workflow_all_handlers_finished(self) -> bool: (source)
def workflow_continue_as_new(self, *args: Any, workflow: None | Callable | str, task_queue: str | None, run_timeout: timedelta | None, task_timeout: timedelta | None, retry_policy: temporalio.common.RetryPolicy | None, memo: Mapping[str, Any] | None, search_attributes: temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes | None, versioning_intent: temporalio.workflow.VersioningIntent | None) -> NoReturn: (source)
def workflow_extern_functions(self) -> Mapping[str, Callable]: (source)
def workflow_get_current_build_id(self) -> str: (source)
def workflow_get_current_details(self) -> str: (source)
def workflow_get_current_history_length(self) -> int: (source)
def workflow_get_current_history_size(self) -> int: (source)
def workflow_get_external_workflow_handle(self, id: str, *, run_id: str | None) -> temporalio.workflow.ExternalWorkflowHandle[Any]: (source)
def workflow_get_query_handler(self, name: str | None) -> Callable | None: (source)
def workflow_get_signal_handler(self, name: str | None) -> Callable | None: (source)
def workflow_get_update_handler(self, name: str | None) -> Callable | None: (source)
def workflow_get_update_validator(self, name: str | None) -> Callable | None: (source)
def workflow_is_continue_as_new_suggested(self) -> bool: (source)
def workflow_is_replaying(self) -> bool: (source)
def workflow_memo(self) -> Mapping[str, Any]: (source)
def workflow_memo_value(self, key: str, default: Any, *, type_hint: type | None) -> Any: (source)
def workflow_patch(self, id: str, *, deprecated: bool) -> bool: (source)
def workflow_random(self) -> random.Random: (source)
def workflow_set_current_details(self, details: str): (source)
def workflow_set_query_handler(self, name: str | None, handler: Callable | None): (source)
def workflow_set_signal_handler(self, name: str | None, handler: Callable | None): (source)
def workflow_set_update_handler(self, name: str | None, handler: Callable | None, validator: Callable | None): (source)
async def workflow_sleep(self, duration: float, *, summary: str | None = None): (source)
def workflow_start_activity(self, activity: Any, *args: Any, task_queue: str | None, result_type: type | None, schedule_to_close_timeout: timedelta | None, schedule_to_start_timeout: timedelta | None, start_to_close_timeout: timedelta | None, heartbeat_timeout: timedelta | None, retry_policy: temporalio.common.RetryPolicy | None, cancellation_type: temporalio.workflow.ActivityCancellationType, activity_id: str | None, versioning_intent: temporalio.workflow.VersioningIntent | None, summary: str | None = None) -> temporalio.workflow.ActivityHandle[Any]: (source)
async def workflow_start_child_workflow(self, workflow: Any, *args: Any, id: str, task_queue: str | None, result_type: type | None, cancellation_type: temporalio.workflow.ChildWorkflowCancellationType, parent_close_policy: temporalio.workflow.ParentClosePolicy, execution_timeout: timedelta | None, run_timeout: timedelta | None, task_timeout: timedelta | None, id_reuse_policy: temporalio.common.WorkflowIDReusePolicy, retry_policy: temporalio.common.RetryPolicy | None, cron_schedule: str, memo: Mapping[str, Any] | None, search_attributes: temporalio.common.SearchAttributes | temporalio.common.TypedSearchAttributes | None, versioning_intent: temporalio.workflow.VersioningIntent | None, static_summary: str | None = None, static_details: str | None = None) -> temporalio.workflow.ChildWorkflowHandle[Any, Any]: (source)
def workflow_start_local_activity(self, activity: Any, *args: Any, result_type: type | None, schedule_to_close_timeout: timedelta | None, schedule_to_start_timeout: timedelta | None, start_to_close_timeout: timedelta | None, retry_policy: temporalio.common.RetryPolicy | None, local_retry_threshold: timedelta | None, cancellation_type: temporalio.workflow.ActivityCancellationType, activity_id: str | None) -> temporalio.workflow.ActivityHandle[Any]: (source)
def workflow_time_ns(self) -> int: (source)
async def workflow_wait_condition(self, fn: Callable[[], bool], *, timeout: float | None = None, timeout_summary: str | None = None): (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

def _apply_resolve_child_workflow_execution_start(self, job: temporalio.bridge.proto.workflow_activation.ResolveChildWorkflowExecutionStart): (source)

Undocumented

def _apply_resolve_request_cancel_external_workflow(self, job: temporalio.bridge.proto.workflow_activation.ResolveRequestCancelExternalWorkflow): (source)

Undocumented

Undocumented

Undocumented

Undocumented

@contextmanager
def _as_read_only(self) -> Iterator[None]: (source)

Undocumented

def _assert_not_read_only(self, action_attempted: str, *, allow_during_delete: bool = False): (source)

Undocumented

async def _cancel_external_workflow(self, command: temporalio.bridge.proto.workflow_commands.WorkflowCommand): (source)

Undocumented

def _check_condition(self, fn: Callable[[], bool], fut: asyncio.Future) -> bool: (source)

Undocumented

def _convert_payloads(self, payloads: Sequence[temporalio.api.common.v1.Payload], types: list[type] | None) -> list[Any]: (source)

Undocumented

def _enhanced_stack_trace(self) -> temporalio.api.sdk.v1.EnhancedStackTrace: (source)

Undocumented

def _instantiate_workflow_object(self) -> Any: (source)

Undocumented

def _is_workflow_failure_exception(self, err: BaseException) -> bool: (source)

Undocumented

def _make_workflow_input(self, init_job: temporalio.bridge.proto.workflow_activation.InitializeWorkflow) -> ExecuteWorkflowInput: (source)

Undocumented

def _next_seq(self, type: str) -> int: (source)

Undocumented

def _outbound_continue_as_new(self, input: ContinueAsNewInput) -> NoReturn: (source)

Undocumented

def _outbound_schedule_activity(self, input: StartActivityInput | StartLocalActivityInput) -> _ActivityHandle: (source)

Undocumented

async def _outbound_signal_child_workflow(self, input: SignalChildWorkflowInput): (source)

Undocumented

async def _outbound_signal_external_workflow(self, input: SignalExternalWorkflowInput): (source)

Undocumented

async def _outbound_start_child_workflow(self, input: StartChildWorkflowInput) -> _ChildWorkflowHandle: (source)

Undocumented

def _process_handler_args(self, job_name: str, job_input: Sequence[temporalio.api.common.v1.Payload], defn_name: str | None, defn_arg_types: list[type] | None, defn_dynamic_vararg: bool) -> list[Any]: (source)

Undocumented

def _register_task(self, task: asyncio.Task, *, name: str | None): (source)

Undocumented

def _run_once(self, *, check_conditions: bool): (source)

Undocumented

async def _run_top_level_workflow_function(self, coro: Awaitable[None]): (source)

Undocumented

def _set_workflow_failure(self, err: BaseException): (source)

Undocumented

async def _signal_external_workflow(self, command: temporalio.bridge.proto.workflow_commands.WorkflowCommand): (source)

Undocumented

def _stack_trace(self) -> str: (source)

Undocumented

def _temporal_workflow_metadata(self) -> temporalio.api.sdk.v1.WorkflowMetadata: (source)

Undocumented

def _timer_handle_cancelled(self, handle: asyncio.TimerHandle): (source)

Undocumented

def _timer_impl(self, delay: float, options: _TimerOptions, callback: Callable[..., Any], *args: Any, context: contextvars.Context | None = None): (source)

Undocumented

def _warn_if_unfinished_handlers(self): (source)

Undocumented

_cancel_requested: bool = (source)

Undocumented

Undocumented

_continue_as_new_suggested = (source)

Undocumented

_curr_seqs: dict[str, int] = (source)

Undocumented

_current_activation_error: Exception | None = (source)

Undocumented

_current_build_id = (source)

Undocumented

_current_completion = (source)

Undocumented

_current_details = (source)

Undocumented

_current_history_length = (source)

Undocumented

_current_history_size = (source)

Undocumented

_current_thread_id: int | None = (source)

Undocumented

Undocumented

_deleting: bool = (source)

Undocumented

_disable_eager_activity_execution = (source)

Undocumented

_exception_handler: _ExceptionHandler | None = (source)

Undocumented

_extern_functions = (source)

Undocumented

_failure_converter = (source)

Undocumented

_handled_signals_seq: int = (source)

Undocumented

_in_progress_signals: dict[int, HandlerExecution] = (source)

Undocumented

_in_progress_updates: dict[str, HandlerExecution] = (source)

Undocumented

_inbound: WorkflowInboundInterceptor = (source)

Undocumented

Undocumented

_is_replaying: bool = (source)

Undocumented

Undocumented

Undocumented

Undocumented

_outbound = (source)

Undocumented

_patches_memoized: dict[str, bool] = (source)

Undocumented

_patches_notified: set[str] = (source)

Undocumented

_payload_converter = (source)

Undocumented

_pending_activities: dict[int, _ActivityHandle] = (source)

Undocumented

_pending_child_workflows: dict[int, _ChildWorkflowHandle] = (source)

Undocumented

_pending_external_cancels: dict[int, asyncio.Future] = (source)

Undocumented

_pending_external_signals: dict[int, asyncio.Future] = (source)

Undocumented

_pending_timers: dict[int, _TimerHandle] = (source)

Undocumented

Undocumented

_queries = (source)

Undocumented

Undocumented

_read_only = (source)

Undocumented

_signals = (source)

Undocumented

Undocumented

_time_ns = (source)

Undocumented

_updates = (source)

Undocumented

_worker_level_failure_exception_types = (source)

Undocumented

_workflow_input: ExecuteWorkflowInput | None = (source)

Undocumented