Skip to main content

Namespace: nexus

Invoke and implement Nexus operations.

Classes​

Interfaces​

Type Aliases​

ActivityOptions​

Ƭ ActivityOptions: Replace<ActivityOptions, { taskQueue?: string }>

Options for starting an untyped activity using TemporalNexusClient.startActivity, this type is identical to the client's ActivityOptions with the exception that taskQueue is optional and defaults to the current worker's task queue.

Nexus support in Temporal SDK is experimental.


ActivityOptionsFor​

Ƭ ActivityOptionsFor<T, N>: Replace<ActivityOptionsFor<T, N>, { taskQueue?: string }>

Options for starting a typed activity using NexusTypedActivityClient.startActivity, this type is identical to the client's ActivityOptionsFor with the exception that taskQueue is optional and defaults to the current worker's task queue.

Nexus support in Temporal SDK is experimental.

Type parameters​

NameType
TT
Nextends ActivityName<T>

TemporalOperationStartHandler​

Ƭ TemporalOperationStartHandler<I, O>: (ctx: TemporalStartOperationContext, client: TemporalNexusClient, input: I) => Promise<TemporalOperationResult<O>>

A handler function for the TemporalOperationHandler constructor.

Temporal Operation handlers are experimental.

Type parameters​

Name
I
O

Type declaration​

▸ (ctx, client, input): Promise<TemporalOperationResult<O>>

Parameters​
NameType
ctxTemporalStartOperationContext
clientTemporalNexusClient
inputI
Returns​

Promise<TemporalOperationResult<O>>


WorkflowRunOperationStartHandler​

Ƭ WorkflowRunOperationStartHandler<I, O>: (ctx: nexus.StartOperationContext, input: I) => Promise<WorkflowHandle<O>>

A handler function for the WorkflowRunOperationHandler constructor.

Type parameters​

Name
I
O

Type declaration​

▸ (ctx, input): Promise<WorkflowHandle<O>>

Parameters​
NameType
ctxnexus.StartOperationContext
inputI
Returns​

Promise<WorkflowHandle<O>>


WorkflowSignalWithStartOptions​

Ƭ WorkflowSignalWithStartOptions<SignalArgs>: Replace<WorkflowSignalWithStartOptions<SignalArgs>, { taskQueue?: string }>

Options for signalWithStartWorkflow, identical to the client's WorkflowSignalWithStartOptions except that taskQueue is optional and defaults to the current worker's task queue.

Type parameters​

NameType
SignalArgsextends any[] = []

WorkflowStartOptions​

Ƭ WorkflowStartOptions<T>: Replace<WorkflowStartOptions<T>, { taskQueue?: string }>

Options for starting a workflow using startWorkflow, this type is identical to the client's WorkflowStartOptions with the exception that taskQueue is optional and defaults to the current worker's task queue.

Type parameters​

NameType
Textends Workflow

Variables​

TemporalOperationResult​

• TemporalOperationResult: Object

Type declaration​

NameType
async<T>(token: string) => TemporalOperationResult<T>
sync<T>(value: T) => TemporalOperationResult<T>

log​

• Const log: Logger

A logger for use in Nexus Handler scope.

This defaults to the Runtime's Logger (see Runtime.logger). Attributes from the current Nexus handler context are automatically included as metadata on every log entries. An extra sdkComponent metadata attribute is also added, with value nexus; this can be used for fine-grained filtering of log entries further downstream.

To customize log attributes, register a nexus.NexusOutboundCallsInterceptor that intercepts the getLogAttributes() method.


metricMeter​

• Const metricMeter: MetricMeter

A metric meter for use in Nexus handler scope, with Nexus handler-specific tags.

To add custom tags, register a nexus.NexusOutboundCallsInterceptor that intercepts the getMetricTags() method.

Functions​

getClient​

▸ getClient(): Client

Returns a client to be used in a Nexus Operation's context, this Client is powered by the same NativeConnection that the worker was created with.

Returns​

Client


operationInfo​

▸ operationInfo(): OperationInfo

Get information about the current Nexus Operation.

Returns​

OperationInfo

OperationInfo for the current Nexus Operation being executed


signalWithStartWorkflow​

▸ signalWithStartWorkflow<T, SignalArgs>(ctx, workflowTypeOrFunc, workflowOptions): Promise<WorkflowHandle<WorkflowResultType<T>>>

Signals a Workflow, starting it first if it is not already running, as part of a Nexus Operation.

Type parameters​

NameType
Textends Workflow
SignalArgsextends any[] = []

Parameters​

NameType
ctxStartOperationContext
workflowTypeOrFuncstring | T
workflowOptionsWithWorkflowArgs<T, WorkflowSignalWithStartOptions<SignalArgs>>

Returns​

Promise<WorkflowHandle<WorkflowResultType<T>>>


startWorkflow​

▸ startWorkflow<T>(ctx, workflowTypeOrFunc, workflowOptions): Promise<WorkflowHandle<WorkflowResultType<T>>>

Starts a workflow run for a WorkflowRunOperationStartHandler, linking the execution chain to a Nexus Operation (subsequent runs started from continue-as-new and retries). Automatically propagates the callback, request ID, and request and response links from the Nexus options to the Workflow.

Type parameters​

NameType
Textends Workflow

Parameters​

NameType
ctxStartOperationContext
workflowTypeOrFuncstring | T
workflowOptionsWorkflowStartOptions<T>

Returns​

Promise<WorkflowHandle<WorkflowResultType<T>>>