class documentation

class ExternalWorkflowHandle(Generic[SelfType]): (source)

Known subclasses: temporalio.worker._workflow_instance._ExternalWorkflowHandle

View In Hierarchy

Handle for interacting with an external workflow.

This is created via get_external_workflow_handle or get_external_workflow_handle_for.

Async Method cancel Send a cancellation request to this external workflow.
Async Method signal Signal this external workflow.
Property id ID for the workflow.
Property run_id Run ID for the workflow if any.
async def cancel(self, *, reason: str = '', event_groups: Sequence[EventGroup] | None = None): (source)

Send a cancellation request to this external workflow.

This will fail if the workflow cannot accept the request (e.g. if the workflow is not found).

Parameters
reason:strReason recorded with the cancellation request. Available in the target workflow via cancellation_reason.
event_groups:Sequence[EventGroup] | NoneEvent Groups to associate this command with, in addition to any from the current Event Group scope.
async def signal(self, signal: MethodSyncOrAsyncNoParam[SelfType, None], *, event_groups: Sequence[EventGroup] | None = None):
async def signal(self, signal: MethodSyncOrAsyncSingleParam[SelfType, ParamType, None], arg: ParamType, *, event_groups: Sequence[EventGroup] | None = None):
async def signal(self, signal: str, arg: Any = temporalio.common._arg_unset, *, args: Sequence[Any] = [], event_groups: Sequence[EventGroup] | None = None):
(source)

Signal this external workflow.

Parameters
signal:str | CallableName or method reference for the signal.
arg:AnySingle argument to the signal.
args:Sequence[Any]Multiple arguments to the signal. Cannot be set if arg is.
event_groups:Sequence[EventGroup] | NoneEvent Groups to associate this command with, in addition to any from the current Event Group scope.