Skip to main content

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 workflowId is passed, and there are multiple Workflow Executions with that ID, the handle will refer to the most recent one.
  • If workflowId and runId are 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

NameType
Textends Workflow

Parameters

NameType
workflowIdstring
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

NameType
Textends Workflow
SignalArgsextends any[] = []

Parameters

NameType
workflowTypeOrFuncstring | T
workflowOptionsWithWorkflowArgs<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

NameType
Textends Workflow

Parameters

NameType
workflowTypeOrFuncstring | T
workflowOptionsWorkflowStartOptions<T>

Returns

Promise<TemporalOperationResult<WorkflowResultType<T>>>