close

Cancel Workflow Run

Request cancellation of a running, queued, or paused workflow run. Cancelling a run already in a terminal state succeeds with no effect. A run produced by a table workflow group is a 409 when its cell can no longer accept the cancellation.

POST/api/v2/workflows/{id}/runs/{runId}/cancel
X-API-Key<token>

Your Sim API key, personal or workspace-scoped. Generate one under Settings, then API Keys. Operations that reject workspace keys say so in their own description.

In: header

Path Parameters

id*string

Unique workflow identifier.

Length1 <= length
runId*string

Unique workflow run identifier.

Match^[A-Za-z0-9._:-]+$
Length1 <= length <= 128

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://www.sim.ai/api/v2/workflows/string/runs/run_8f14e45f-ceea-467f-a/cancel" \  -H "X-API-Key: YOUR_API_KEY"
{
  "data": {
    "success": true,
    "runId": "run_8f14e45f-ceea-467f-a",
    "redisAvailable": true,
    "durablyRecorded": true,
    "locallyAborted": true,
    "pausedCancelled": false,
    "reason": "recorded"
  }
}
{
  "error": {
    "code": "BAD_REQUEST",
    "message": "Invalid request"
  }
}
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "API key required"
  }
}
{
  "error": {
    "code": "FORBIDDEN",
    "message": "Insufficient workspace permissions",
    "details": {
      "code": "INSUFFICIENT_WORKSPACE_ROLE"
    }
  }
}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Not found"
  }
}
{
  "error": {
    "code": "CONFLICT",
    "message": "Webhook path already in use"
  }
}
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "API rate limit exceeded",
    "details": {
      "retryAfter": "2026-01-01T00:00:30.000Z"
    }
  }
}
{
  "error": {
    "code": "INTERNAL_ERROR",
    "message": "Internal server error"
  }
}
{
  "error": {
    "code": "SERVICE_UNAVAILABLE",
    "message": "Service temporarily unavailable"
  }
}