Interface: WorkflowHandle<T>
nexus.WorkflowHandle
A handle to a running workflow that is returned by the startWorkflow helper. This handle should be returned by WorkflowRunOperationStartHandler implementations.
The type parameter T carries the workflow's result type for downstream type inference in
WorkflowRunOperationHandler. It is encoded in the workflowResultType brand so
that WorkflowHandle<string> and WorkflowHandle<number> are structurally distinct.
Type parameters
| Name |
|---|
T |
Hierarchy
-
WorkflowHandle
Properties
runId
• Optional Readonly runId: string
workflowId
• Readonly workflowId: string
Methods
query
▸ query<Ret, Args>(def, ...args): Promise<Ret>
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
| Name | Type |
|---|---|
Ret | Ret |
Args | extends any[] = [] |
Parameters
| Name | Type |
|---|---|
def | string | QueryDefinition<Ret, Args, string> |
...args | Args |
Returns
Promise<Ret>
signal
▸ signal<Args, Name>(def, ...args): Promise<void>
Type parameters
| Name | Type |
|---|---|
Args | extends any[] = [] |
Name | extends string = string |
Parameters
| Name | Type |
|---|---|
def | string | SignalDefinition<Args, Name> |
...args | Args |
Returns
Promise<void>