Interface: TemporalNexusClient
nexus.TemporalNexusClient
A Nexus-aware Temporal Client for use inside TemporalOperationHandler implementations.
Temporal Operation handlers are experimental.
Properties
client
• Readonly client: Client
The Temporal Client for the active Nexus Operation.
Temporal Operation handlers are experimental.
Methods
getWorkflowHandle
▸ getWorkflowHandle<T>(workflowId, runId?): UpdatableWorkflowHandle<WorkflowResultType<T>>
Create a Nexus-aware handle to an existing Workflow.
- If only
workflowIdis passed, and there are multiple Workflow Executions with that ID, the handle will refer to the most recent one. - If
workflowIdandrunIdare passed, the handle will refer to the specific Workflow Execution with that Run ID.
This method does not validate workflowId. If there is no Workflow Execution with the given workflowId, handle
methods like handle.signal() will throw a WorkflowNotFoundError error.
Temporal Operation handlers are experimental.
Type parameters
| Name | Type |
|---|---|
T | extends Workflow |
Parameters
| Name | Type |
|---|---|
workflowId | string |
runId? | string |
Returns
UpdatableWorkflowHandle<WorkflowResultType<T>>
signalWithStartWorkflow
▸ signalWithStartWorkflow<T, SignalArgs>(workflowTypeOrFunc, workflowOptions): Promise<void>
Signals a Workflow, starting it first if it is not already running, forwarding the Nexus Operation's request links and propagating the response link the server returns (when supported).
Temporal Operation handlers are experimental.
Type parameters
| Name | Type |
|---|---|
T | extends Workflow |
SignalArgs | extends any[] = [] |
Parameters
| Name | Type |
|---|---|
workflowTypeOrFunc | string | T |
workflowOptions | WithWorkflowArgs<T, WorkflowSignalWithStartOptions<SignalArgs>> |
Returns
Promise<void>
startActivity
▸ startActivity<R>(activity, options): Promise<TemporalOperationResult<R>>
Type parameters
| Name | Type |
|---|---|
R | any |
Parameters
| Name | Type |
|---|---|
activity | string |
options | ActivityOptions |
Returns
Promise<TemporalOperationResult<R>>
startWorkflow
▸ startWorkflow<T>(workflowTypeOrFunc, workflowOptions): Promise<TemporalOperationResult<WorkflowResultType<T>>>
Starts a workflow run as the asynchronous backing operation for the current Nexus Operation.
Temporal Operation handlers are experimental.
Type parameters
| Name | Type |
|---|---|
T | extends Workflow |
Parameters
| Name | Type |
|---|---|
workflowTypeOrFunc | string | T |
workflowOptions | WorkflowStartOptions<T> |
Returns
Promise<TemporalOperationResult<WorkflowResultType<T>>>
typedActivity
▸ typedActivity<T>(): NexusTypedActivityClient<T>
Returns this client as a NexusTypedActivityClient. It enables strong type checking of Activity name, arguments and result based on the provided Activity interface. Note that no new client object is created - this method only affects type annotations.
Type parameters
| Name | Description |
|---|---|
T | Activity interface to use for type checking. The returned client can only start activities present in this interface. Nexus support in Temporal SDK is experimental. |