nexus
Invoke and implement Nexus operations.
Classes
Interfaces
- CancelActivityOptions
- CancelWorkflowRunOptions
- CancelWorkflowUpdateOptions
- NexusTypedActivityClient
- NexusUpdateWorkflowOptions
- OperationInfo
- TemporalCancelOperationContext
- TemporalNexusClient
- TemporalOperationHandlerOptions
- TemporalOperationResult
- TemporalStartOperationContext
- UpdatableWorkflowHandle
- WorkflowHandle
Type Aliases
ActivityOptions
ActivityOptions =
Replace<ActivityOptions, {taskQueue?:string; }>
Experimental
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; }>
Experimental
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
T
T
N
N extends ActivityName<T>
TemporalOperationStartHandler
TemporalOperationStartHandler<
I,O> = (ctx,client,input) =>Promise<TemporalOperationResult<O>>
Experimental
A handler function for the TemporalOperationHandler constructor.
Temporal Operation handlers are experimental.
Type Parameters
I
I
O
O
Parameters
ctx
client
input
I
Returns
Promise<TemporalOperationResult<O>>
WorkflowRunOperationStartHandler
WorkflowRunOperationStartHandler<
I,O> = (ctx,input) =>Promise<WorkflowHandle<O>>
A handler function for the WorkflowRunOperationHandler constructor.
Type Parameters
I
I
O
O
Parameters
ctx
nexus.StartOperationContext
input
I
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
SignalArgs
SignalArgs extends 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
T
T extends Workflow
Variables
log
constlog: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
constmetricMeter: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.
TemporalOperationResult
TemporalOperationResult:
object
Type Declaration
async()
async<
T>(token):TemporalOperationResult<T>
Type Parameters
T
T = unknown
Parameters
token
string
Returns
sync()
sync<
T>(value):TemporalOperationResult<T>
Type Parameters
T
T
Parameters
value
T
Returns
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
operationInfo()
operationInfo():
OperationInfo
Get information about the current Nexus Operation.
Returns
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
T
T extends Workflow
SignalArgs
SignalArgs extends any[] = []
Parameters
ctx
StartOperationContext
workflowTypeOrFunc
string | T
workflowOptions
WithWorkflowArgs<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
T
T extends Workflow
Parameters
ctx
StartOperationContext
workflowTypeOrFunc
string | T
workflowOptions
Returns
Promise<WorkflowHandle<WorkflowResultType<T>>>