# cancel

> **Method** in `@langchain/langgraph-sdk`

📖 [View in docs](https://reference.langchain.com/javascript/langchain-langgraph-sdk/client/RunsClient/cancel)

Cancel a run.

## Signature

```javascript
cancel(threadId: string, runId: string, wait: boolean = false, action: CancelAction = "interrupt", options: __type = {}): Promise<void>
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `threadId` | `string` | Yes | The ID of the thread. |
| `runId` | `string` | Yes | The ID of the run. |
| `wait` | `boolean` | No | Whether to block when canceling (default: `false`) |
| `action` | `CancelAction` | No | Action to take when cancelling the run. Possible values are `interrupt` or `rollback`. Default is `interrupt`. (default: `"interrupt"`) |
| `options` | `__type` | No |  (default: `{}`) |

## Returns

`Promise<void>`

---

[View source on GitHub](https://github.com/langchain-ai/langgraphjs/blob/f38b91c6ede1ca8416034825f3d80f3f9a4700ff/libs/sdk/src/client.ts#L1677)