Interface: UpdatableWorkflowHandle<T>
Experimental
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.
Workflow Updates as Nexus Operations are experimental.
Extends
Type Parameters
T
T
Properties
runId?
readonlyoptionalrunId?:string
Experimental
Inherited from
workflowId
readonlyworkflowId:string
Experimental
Inherited from
Methods
query()
query<
Ret,Args>(def, ...args):Promise<Ret>
Experimental
Queries the Workflow as part of this Nexus Operation.
A Query resolves immediately and writes nothing to history, so this backs a synchronous operation: there is no operation token and nothing to cancel. The link the server returns for the Workflow that processed the Query is attached to the operation's outbound links, so the caller's NexusOperation history event points back at that Workflow.
Type Parameters
Ret
Ret
Args
Args extends any[] = []
Parameters
def
string | QueryDefinition<Ret, Args, string>
args
...Args
Returns
Promise<Ret>
Inherited from
signal()
signal<
Args,Name>(def, ...args):Promise<void>
Experimental
Type Parameters
Args
Args extends any[] = []
Name
Name extends string = string
Parameters
def
string | SignalDefinition<Args, Name>
args
...Args
Returns
Promise<void>
Inherited from
update()
Call Signature
update<
Ret,Args,Name>(def,options):Promise<TemporalOperationResult<Ret>>
Experimental
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.
options.waitForStage is required and must be ACCEPTED, so options are always passed, even
for an Update that takes no arguments. If the Update takes arguments, options.args is also
required; an Update that takes no arguments accepts no args.
Workflow Updates as Nexus Operations are experimental.
Type Parameters
Ret
Ret
Args
Args extends [any, ...any[]]
Name
Name extends string = string
Parameters
def
string | UpdateDefinition<Ret, Args, Name>
options
NexusUpdateWorkflowOptions & object
Returns
Promise<TemporalOperationResult<Ret>>
Call Signature
update<
Ret,Args,Name>(def,options):Promise<TemporalOperationResult<Ret>>
Experimental
Type Parameters
Ret
Ret
Args
Args extends [] = []
Name
Name extends string = string
Parameters
def
string | UpdateDefinition<Ret, Args, Name>
options
NexusUpdateWorkflowOptions & object
Returns
Promise<TemporalOperationResult<Ret>>