Skip to main content

Interface: UpdatableWorkflowHandle<T>

nexus.UpdatableWorkflowHandle

A WorkflowHandle that can additionally back the current Nexus Operation with a Workflow Update. Returned by TemporalNexusClient.getWorkflowHandle.

update lives on this interface rather than on WorkflowHandle so that the handles returned by startWorkflow and signalWithStartWorkflow do not advertise it: the Workflow run they refer to already backs the operation, and a Nexus Operation handler invocation may only start one async backing operation.

Nexus support in Temporal SDK is experimental.

Type parameters

Name
T

Hierarchy

Properties

runId

Optional Readonly runId: string

Inherited from

WorkflowHandle.runId


workflowId

Readonly workflowId: string

Inherited from

WorkflowHandle.workflowId

Methods

signal

signal<Args, Name>(def, ...args): Promise<void>

Type parameters

NameType
Argsextends any[] = []
Nameextends string = string

Parameters

NameType
defstring | SignalDefinition<Args, Name>
...argsArgs

Returns

Promise<void>

Inherited from

WorkflowHandle.signal


update

update<Ret, Args, Name>(def, options): Promise<TemporalOperationResult<Ret>>

Sends an Update to this Workflow as the backing operation for the current Nexus Operation.

The Update request is augmented with the Nexus Operation's request ID (for deduplication), its request links, and a completion callback carrying the operation token, so the Update's completion is delivered back to the Nexus caller.

Only asynchronous, ACCEPTED-stage Updates are supported: this method returns once the Update is accepted, yielding an asynchronous TemporalOperationResult whose completion is delivered via the callback. If the Update has already completed by the time it is accepted (for example a retried request with the same Update ID, or an Update that completes immediately), a synchronous result is returned instead; if that completed Update failed (e.g. validation rejection, which is non-retryable), it surfaces as a failed Nexus Operation.

If the Update takes arguments, options.args is required; an Update that takes no arguments accepts no args and may be called without options at all.

Nexus support in Temporal SDK is experimental.

Type parameters

NameType
RetRet
Argsextends [any, ...any[]]
Nameextends string = string

Parameters

NameType
defstring | UpdateDefinition<Ret, Args, Name>
optionsNexusUpdateWorkflowOptions & { args: Args }

Returns

Promise<TemporalOperationResult<Ret>>

update<Ret, Args, Name>(def, options?): Promise<TemporalOperationResult<Ret>>

Type parameters

NameType
RetRet
Argsextends [] = []
Nameextends string = string

Parameters

NameType
defstring | UpdateDefinition<Ret, Args, Name>
options?NexusUpdateWorkflowOptions & { args?: Args }

Returns

Promise<TemporalOperationResult<Ret>>