Skip to main content

Interface: NexusClient<T>

workflow.NexusClient

A Nexus client for invoking Nexus Operations for a specific service from a Workflow.

Nexus support in Temporal SDK is experimental.

Type parameters

NameType
Textends nexus.ServiceDefinition

Methods

executeOperation

executeOperation<O>(op, input, options?): Promise<OperationOutput<O>>

Start a Nexus Operation and wait for its completion taking a nexus.operation. Returns the operation's result.

Nexus support in Temporal SDK is experimental.

Type parameters

NameType
Oextends OperationDefinition<any, any>

Parameters

NameType
opO
inputOperationInput<O>
options?Partial<StartNexusOperationOptions>

Returns

Promise<OperationOutput<O>>

executeOperation<K>(op, input, options?): Promise<OperationOutput<T["operations"][K]>>

Start a Nexus Operation and wait for its completion, taking an Operation's property name. Returns the operation's result.

An Operation's property name is the name of the property used to define that Operation in the nexus.ServiceDefinition object; it may differ from the value of the name property if one was explicitly specified on the nexus.OperationDefinition object.

Nexus support in Temporal SDK is experimental.

Type parameters

NameType
Kextends string

Parameters

NameType
opK
inputOperationInput<T["operations"][K]>
options?Partial<StartNexusOperationOptions>

Returns

Promise<OperationOutput<T["operations"][K]>>


startOperation

startOperation<O>(op, input, options?): Promise<NexusOperationHandle<OperationOutput<O>>>

Start a Nexus Operation taking a nexus.operation.

Returns a handle that can be used to wait for the Operation's result.

Nexus support in Temporal SDK is experimental.

Type parameters

NameType
Oextends OperationDefinition<any, any>

Parameters

NameType
opO
inputOperationInput<O>
options?Partial<StartNexusOperationOptions>

Returns

Promise<NexusOperationHandle<OperationOutput<O>>>

startOperation<K>(op, input, options?): Promise<NexusOperationHandle<OperationOutput<T["operations"][K]>>>

Start a Nexus Operation, taking an Operation's property name. Returns a handle that can be used to wait for the Operation's result.

An Operation's property name is the name of the property used to define that Operation in the nexus.ServiceDefinition object; it may differ from the value of the name property if one was explicitly specified on the nexus.OperationDefinition object.

Nexus support in Temporal SDK is experimental.

Type parameters

NameType
Kextends string

Parameters

NameType
opK
inputOperationInput<T["operations"][K]>
options?Partial<StartNexusOperationOptions>

Returns

Promise<NexusOperationHandle<OperationOutput<T["operations"][K]>>>