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

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Cancel deployment

> Cancel an Automate.ax deployment before publishing begins.

`automate.cancelDeployment` cancels a deployment in `planning`, `awaiting_authorization`, or `configuring` state.

```ts automations/cancel-deployment.automation.ts theme={null}
import { automation } from "automate.ax"
import { automate } from "automate.ax/automate"

export default automation("Cancel deployment", () => {
  automate.cancelDeployment({ deploymentId: "dep_123" })
})
```

Cancelling an already cancelled deployment succeeds without scheduling another cleanup, so retrying the action is safe. Deployments that reached `publishing`, `succeeded`, or `failed` cannot be cancelled. The action requires `deployment:cancel`.
