---
title: "Cancel a workflow"
method: DELETE
path: "/organizations/{organization}/databases/{database}/workflows/{number}"
tags: ["Workflows"]
---

# Cancel a workflow

`DELETE /organizations/{organization}/databases/{database}/workflows/{number}`

## Path parameters

- `organization` string, required
- `database` string, required
- `number` integer, required

## Response `200`

Returns a workflow

- object
  - `id` string, required — The ID of the workflow
  - `name` string, required — The name of the workflow
  - `number` integer, required — The sequence number of the workflow
  - `state` 'pending' | 'copying' | 'running' | 'stopped' | 'verifying_data' | 'verified_data' | 'switching_replicas' | 'switched_replicas' | 'switching_primaries' | 'switched_primaries' | 'reversing_traffic' | 'reversing_traffic_for_cancel' | 'cutting_over' | 'cutover' | 'reversed_cutover' | 'completed' | 'cancelling' | 'cancelled' | 'error', required — The state of the workflow
  - `created_at` string, required — When the workflow was created
  - `updated_at` string, required — When the workflow was last updated
  - `started_at` string, nullable, required — When the workflow was started
  - `completed_at` string, nullable, required — When the workflow was completed
  - `cancelled_at` string, nullable, required — When the workflow was cancelled
  - `reversed_at` string, nullable, required — When the workflow was reversed
  - `retried_at` string, nullable, required — When the workflow was retried
  - `data_copy_completed_at` string, nullable, required — When the data copy was completed
  - `cutover_at` string, nullable, required — When the cutover was completed
  - `replicas_switched` boolean, required — Whether or not the replicas have been switched
  - `primaries_switched` boolean, required — Whether or not the primaries have been switched
  - `switch_replicas_at` string, nullable, required — When the replicas were switched
  - `switch_primaries_at` string, nullable, required — When the primaries were switched
  - `verify_data_at` string, nullable, required — When the data was verified
  - `workflow_type` 'move_tables', required — The type of the workflow
  - `workflow_subtype` string, required — The subtype of the workflow
  - `defer_secondary_keys` boolean, required — Whether or not secondary keys are deferred
  - `on_ddl` 'IGNORE' | 'STOP' | 'EXEC' | 'EXEC_IGNORE', required — The behavior when DDL changes during the workflow
  - `workflow_errors` string, required — The errors that occurred during the workflow
  - `may_retry` boolean, required — Whether or not the workflow may be retried
  - `may_restart` boolean, required — Whether or not the workflow may be restarted
  - `verified_data_stale` boolean, required — Whether or not the verified data is stale
  - `sequence_tables_applied` boolean, required — Whether or not sequence tables have been created
  - `actor` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `verify_data_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `reversed_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `switch_replicas_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `switch_primaries_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `cancelled_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `completed_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `retried_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `cutover_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `reversed_cutover_by` object, required
    - `id` string, required — The ID of the actor
    - `display_name` string, required — The name of the actor
    - `avatar_url` string, required — The URL of the actor's avatar
  - `branch` object, required
    - `id` string, required — The ID for the resource
    - `name` string, required — The name for the resource
    - `created_at` string, required — When the resource was created
    - `updated_at` string, required — When the resource was last updated
    - `deleted_at` string, nullable, required — When the resource was deleted, if deleted
  - `source_keyspace` object, required
    - `id` string, required — The ID for the resource
    - `name` string, required — The name for the resource
    - `created_at` string, required — When the resource was created
    - `updated_at` string, required — When the resource was last updated
    - `deleted_at` string, nullable, required — When the resource was deleted, if deleted
  - `target_keyspace` object, required
    - `id` string, required — The ID for the resource
    - `name` string, required — The name for the resource
    - `created_at` string, required — When the resource was created
    - `updated_at` string, required — When the resource was last updated
    - `deleted_at` string, nullable, required — When the resource was deleted, if deleted
  - `global_keyspace` object, required
    - `id` string, required — The ID for the resource
    - `name` string, required — The name for the resource
    - `created_at` string, required — When the resource was created
    - `updated_at` string, required — When the resource was last updated
    - `deleted_at` string, nullable, required — When the resource was deleted, if deleted

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

## Changes

- **2026-06-01** `72506953f367` — 14 breaking
  - the response property `branch/deleted_at` became nullable for the status `200`
  - the response property `cancelled_at` became nullable for the status `200`
  - the response property `completed_at` became nullable for the status `200`
  - the response property `cutover_at` became nullable for the status `200`
  - …10 more
- **2025-12-09** `d710019068fb` — 1 breaking
  - for the `path` request parameter `number`, the type/format was changed from `number`/`` to `integer`/``
- **2025-12-06** `477c6ebdabdf` — 1 breaking
  - for the `path` request parameter `number`, the type/format was changed from `string`/`` to `number`/``

[Change history](https://skmtc.dev/planetscale/apis/planetscale-api/changes/organizations/:organization/databases/:database/workflows/:number/delete.md)

---

[API](https://skmtc.dev/planetscale/apis/planetscale-api.md) · [All operations](https://skmtc.dev/planetscale/apis/planetscale-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/planetscale/planetscale-api/revisions/6d28c038c4fd/schema)
