> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfycontrol.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Workflow

> Cancel a running or queued workflow

## Overview

Cancel a workflow that is currently queued or running. This gracefully stops the workflow execution and updates its status to `cancelled`.

<Note>
  Only workflows in `queued` or `running` status can be cancelled. Completed, failed, or already cancelled workflows cannot be cancelled again.
</Note>

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier (UUID) of the workflow to cancel.
</ParamField>

## Response

Returns a 200 OK status with no body on successful cancellation.

## Example Response

```
Status: 200 OK
```

## Error Responses

<ResponseField name="400" type="error">
  Bad request - workflow cannot be cancelled.

  Common causes:

  * Workflow is already in a terminal state (`completed`, `failed`, `cancelled`)
  * Workflow status is `accepted` or `uploaded` (not yet queued)
</ResponseField>

<ResponseField name="401" type="error">
  Unauthorized - invalid or missing authentication token.
</ResponseField>

<ResponseField name="404" type="error">
  Not Found - workflow with the specified ID does not exist or does not belong to your account.
</ResponseField>

<ResponseField name="500" type="error">
  Internal Server Error - unable to communicate with the runner to cancel the workflow.
</ResponseField>

## Notes

* Cancellation is a graceful operation that signals the runner to stop execution
* The workflow status will be updated to `cancelled` after successful cancellation
* Any partially generated outputs may or may not be saved depending on when cancellation occurs
* Use this to stop long-running or stuck workflows
* Cancellation may take a few seconds to complete as the runner processes the signal
* If the workflow completes before the cancellation signal is processed, it will remain in `completed` status
* Cancelled workflows count toward your workflow history
