Skip to main content

Overview

Cancels an actively executing run. If the run has already finished (completed, failed, canceled, etc.) this is a no-op.
Authentication with a secret key is required.

Endpoint

POST https://api.trigger.dev/api/v2/runs/{runId}/cancel

Path parameters

runId
string
required
The unique run ID to cancel, prefixed with run_.

Response

id
string
The ID of the run that was canceled.

Examples

import { runs } from "@trigger.dev/sdk";

await runs.cancel("run_p4omhh45hgxxnq1re6ovy");

Response example

{
  "id": "run_p4omhh45hgxxnq1re6ovy"
}

Build docs developers (and LLMs) love