Interface: TemporalNexusClient
nexus.TemporalNexusClient
A Nexus-aware Temporal Client for use inside TemporalOperationHandler implementations.
Nexus support in Temporal SDK is experimental.
Properties
client
• Readonly client: Client
The Temporal Client for the active Nexus Operation.
Nexus support in Temporal SDK is experimental.
Methods
getWorkflowHandle
▸ getWorkflowHandle<T>(workflowId, runId?): WorkflowHandle<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.
Nexus support in Temporal SDK is experimental.
Type parameters
| Name | Type |
|---|---|
T | extends Workflow |
Parameters
| Name | Type |
|---|---|
workflowId | string |
runId? | string |
Returns
WorkflowHandle<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).
Nexus support in Temporal SDK is 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>
startWorkflow
▸ startWorkflow<T>(workflowTypeOrFunc, workflowOptions): Promise<TemporalOperationResult<WorkflowResultType<T>>>
Starts a workflow run as the asynchronous backing operation for the current Nexus Operation.
Nexus support in Temporal SDK is experimental.
Type parameters
| Name | Type |
|---|---|
T | extends Workflow |
Parameters
| Name | Type |
|---|---|
workflowTypeOrFunc | string | T |
workflowOptions | WorkflowStartOptions<T> |
Returns
Promise<TemporalOperationResult<WorkflowResultType<T>>>