Skip to main content

Run.cancel()

The .cancel() method cancels a workflow run, stopping execution and cleaning up resources.

Usage example

const run = await workflow.createRunAsync();

await run.cancel();

Parameters

No parameters:

void
This method takes no parameters

Returns

result:

Promise<void>
A promise that resolves when the workflow run has been cancelled

Extended usage example

const run = await workflow.createRunAsync();

try {
const result = await run.start({ inputData: { value: "initial data" } });
} catch (error) {
await run.cancel();
}