Namespace: nexus
Invoke and implement Nexus operations.
Classes
Interfaces
Type Aliases
WorkflowRunOperationStartHandler
Ƭ WorkflowRunOperationStartHandler<I, O>: (ctx: nexus.StartOperationContext, input: I) => Promise<WorkflowHandle<O>>
A handler function for the WorkflowRunOperationHandler constructor.
Nexus support in Temporal SDK is experimental.
Type parameters
| Name |
|---|
I |
O |
Type declaration
▸ (ctx, input): Promise<WorkflowHandle<O>>
Parameters
| Name | Type |
|---|---|
ctx | nexus.StartOperationContext |
input | I |
Returns
Promise<WorkflowHandle<O>>
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.
Nexus support in Temporal SDK is experimental.
Type parameters
| Name | Type |
|---|---|
T | extends Workflow |
Variables
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.
Nexus support in Temporal SDK is experimental.
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.
Nexus support in Temporal SDK is experimental.
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.
Nexus support in Temporal SDK is experimental.
Returns
startWorkflow
▸ startWorkflow<T>(ctx, workflowTypeOrFunc, workflowOptions): Promise<WorkflowHandle<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 back and forward links from the Nexus options to the Workflow.
Nexus support in Temporal SDK is experimental.
Type parameters
| Name | Type |
|---|---|
T | extends Workflow |
Parameters
| Name | Type |
|---|---|
ctx | StartOperationContext |
workflowTypeOrFunc | string | T |
workflowOptions | WorkflowStartOptions<T> |
Returns
Promise<WorkflowHandle<T>>