Skip to main content

Interface: ExternalWorkflowHandle

workflow.ExternalWorkflowHandle

Handle representing an external Workflow Execution.

This handle only has methods cancel and signal. To call other methods, like query and result, use WorkflowClient.getHandle inside an Activity.

Properties

runId

Optional Readonly runId: string

An optional runId of the external Workflow


workflowId

Readonly workflowId: string

The workflowId of the external Workflow

Methods

cancel

cancel(): Promise<void>

Cancel the external Workflow execution.

Throws if the Workflow execution does not exist.

Returns

Promise<void>


signal

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

Signal a running Workflow.

Type parameters

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

Parameters

NameTypeDescription
defstring | SignalDefinition<Args, Name>a signal definition as returned from defineSignal or signal name (string)
...argsArgs-

Returns

Promise<void>

Example

await handle.signal(incrementSignal, 3);