TemporalEx.WorkflowHandle
(temporal_ex v0.2.1)
Copy Markdown
A handle to a running or completed workflow execution.
Carries the client reference, workflow ID, run ID, and namespace so
that callers never need to pass the client or IDs again after
obtaining a handle from TemporalEx.start_workflow/4 or
TemporalEx.get_workflow_handle/3.
Summary
Functions
Requests cancellation of the workflow execution.
Deletes the workflow execution from visibility.
Describes the workflow execution.
Fetches the workflow execution history.
Queries the workflow execution.
Resets the workflow execution to a specific point.
Long-polls for the workflow result by watching for close events in history.
Sends a signal to the workflow execution.
Terminates the workflow execution.
Types
@type t() :: %TemporalEx.WorkflowHandle{ client: GenServer.server(), first_execution_run_id: String.t() | nil, namespace: String.t() | nil, run_id: String.t() | nil, workflow_id: String.t() }
Functions
@spec cancel( t(), keyword() ) :: :ok | {:error, TemporalEx.Error.t()}
Requests cancellation of the workflow execution.
Options
:identity— Caller identity:request_id— Idempotency key
@spec delete( t(), keyword() ) :: :ok | {:error, TemporalEx.Error.t()}
Deletes the workflow execution from visibility.
@spec describe( t(), keyword() ) :: {:ok, struct()} | {:error, TemporalEx.Error.t()}
Describes the workflow execution.
Returns info including status, start time, close time, type, task queue, etc.
@spec get_history( t(), keyword() ) :: {:ok, map()} | {:error, TemporalEx.Error.t()}
Fetches the workflow execution history.
Options
:reverse— Iftrue, returns events in reverse chronological order (default:false):page_size— Maximum number of events per page (default: 1000):next_page_token— Token for pagination:wait_new_event— Iftrue, long-polls for new events (default:false):filter_type— Event filter type atom
Queries the workflow execution.
Options
:reject_condition— When to reject the query (e.g.,:not_open,:not_completed_cleanly)
@spec reset( t(), keyword() ) :: {:ok, String.t()} | {:error, TemporalEx.Error.t()}
Resets the workflow execution to a specific point.
Options
:workflow_task_finish_event_id— Event ID to reset to (required):reason— Reset reason:request_id— Idempotency key:reset_reapply_type— How to reapply signals (default::RESET_REAPPLY_TYPE_SIGNAL)
@spec result( t(), keyword() ) :: {:ok, term()} | {:error, TemporalEx.Error.t() | term()}
Long-polls for the workflow result by watching for close events in history.
Options
:timeout— Maximum time to wait in milliseconds:follow_runs— Iftrue, follows continue-as-new chains (default:true)
@spec signal(t(), String.t(), list(), keyword()) :: :ok | {:error, TemporalEx.Error.t()}
Sends a signal to the workflow execution.
Options
:identity— Caller identity:request_id— Idempotency key
@spec terminate( t(), keyword() ) :: :ok | {:error, TemporalEx.Error.t()}
Terminates the workflow execution.
Options
:reason— Human-readable termination reason:details— Additional data to record with the termination:identity— Caller identity