# cancel()

Canonical URL: https://developers.iagenify.com/sdk/ref/workflow-run/cancel/
Language: en

`run.cancel() → Promise<WorkflowRun>`

Stops the run. What already happened stays happened — a message sent is sent, a deploy is online.

Status: stops the chain · undoes nothing · status: cancelled

```javascript
await run.cancel();
console.log(run.data.status);   // "cancelled"
```

## What it stops {#what}

The chain. No further step starts. A step already in flight finishes rather than being torn in half.

> **Cancelling is not undoing**
>
> Every effect a completed step had is permanent: documents written, mail delivered, a site published, a DNS record changed. Cancel stops what has not happened yet.

## It works on a waiting run too {#waiting}

An approval that will never come is a run that waits for ever. Cancelling is how it is closed, and the record shows it was cancelled rather than refused.

## The record is kept {#record}

Every step that ran, with its output, its credits and its warnings. A cancelled run is still the account of what was done.

## A cancelled run cannot be resumed {#no-restart}

[retry()](/sdk/ref/workflow-run/retry) is for a failed run. To do the work again, start a new run.

- [retry()](/sdk/ref/workflow-run/retry): For a failure instead.
- [run()](/sdk/ref/workflow/run): Starting again.

```python
run.cancel()
print(run.data["status"])   # "cancelled"
```
