Skip to main content

Class: NexusHandler

NexusHandler callbacks are requests to invoke a specific shape of Nexus operation on a Temporal worker. The specified Nexus operation must have the following:

  • Input: temporal.api.notificationservice.v1.OnCompleteRequest
  • Output: temporal.api.notificationservice.v1.OnCompleteResponse

The targeted Nexus service must be registered within the same namespace as the source operation the callback is attached to. (While Nexus allows for cross-namespace operations, NexusHandler callbacks are strictly caller-side.)

NexusHandler callbacks are only supported for certain types of operations, e.g. standalone Nexus operations. Attempting to attach a Worker callback for an unsupported operation will result in an INVALID_ARGUMENT error from the server.

Properties​

operation​

operation: string

Target operation, e.g. "DeliverAsWebhook".


service​

service: string

Target Nexus service, e.g. "HTTPAdapter".


sourceContext?​

optional sourceContext?: $Properties | null

Arbitrary user-supplied data from the source operation's callsite. (As applicable, not all operations support attaching context data.)

There are restrictions on the maxium payload size a single callback can carry, as well as the total sum of all source context payloads attached to an execution. See dynamic configuration: "callback.nexusHandler.sourceContext.maxSize", "callback.nexusHandler.sourceContext.aggregateMaxSize".


taskQueueName​

taskQueueName: string

Nexus task queue the Temporal worker is listening on.

NOTE: This is not a temporal.api.taskqueue.v1.TaskQueue to avoid a circular dependency.

Methods​

toJSON()​

toJSON(): object

Converts this NexusHandler to JSON.

Returns​

object

JSON object


create()​

Call Signature​

static create(properties?): NexusHandler & $Properties

Creates a new NexusHandler instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

NexusHandler & $Properties

NexusHandler instance

Call Signature​

static create(properties?): NexusHandler

Creates a new NexusHandler instance using the specified properties.

Parameters​
properties?​

$Properties

Properties to set

Returns​

NexusHandler

NexusHandler instance


decode()​

static decode(reader, length?): NexusHandler & $Properties

Decodes a NexusHandler message from the specified reader or buffer.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

length?​

number

Message length if known beforehand

Returns​

NexusHandler & $Properties

NexusHandler

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


decodeDelimited()​

static decodeDelimited(reader): NexusHandler & $Properties

Decodes a NexusHandler message from the specified reader or buffer, length delimited.

Parameters​

reader​

Uint8Array<ArrayBufferLike> | Reader

Reader or buffer to decode from

Returns​

NexusHandler & $Properties

NexusHandler

Throws​

If the payload is not a reader or valid buffer

Throws​

If required fields are missing


encode()​

static encode(message, writer?): Writer

Encodes the specified NexusHandler message. Does not implicitly temporal.api.common.v1.Callback.NexusHandler.verify|verify messages.

Parameters​

message​

$Properties

NexusHandler message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


encodeDelimited()​

static encodeDelimited(message, writer?): Writer

Encodes the specified NexusHandler message, length delimited. Does not implicitly temporal.api.common.v1.Callback.NexusHandler.verify|verify messages.

Parameters​

message​

$Properties

NexusHandler message or plain object to encode

writer?​

Writer

Writer to encode to

Returns​

Writer

Writer


fromObject()​

static fromObject(object): NexusHandler

Creates a NexusHandler message from a plain object. Also converts values to their respective internal types.

Parameters​

object​

Plain object

Returns​

NexusHandler

NexusHandler


toObject()​

static toObject(message, options?): object

Creates a plain object from a NexusHandler message. Also converts values to other types if specified.

Parameters​

message​

NexusHandler

NexusHandler

options?​

IConversionOptions

Conversion options

Returns​

object

Plain object