> ## 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.

# On Automate.ax deployment cancelled

> Run an automation when a deployment is cancelled.

`automate.onDeploymentCancelled` emits when a cancellable deployment becomes cancelled, including when creating a replacement deployment cancels in-progress work.

```ts automations/watch-cancelled-deployments.automation.ts theme={null}
import { automation } from "automate.ax"
import { automate } from "automate.ax/automate"

export default automation("Watch cancelled deployments", () => {
  automate.onDeploymentCancelled({
    account: "operations",
    projectId: "proj_01",
  })
})
```

When `account` is omitted, the trigger uses the deploying project's organization. An explicit static Automate.ax binding requires `deployment:read` and can select another organization. `projectId` must identify a project in the resulting organization.

## Trigger data

Returns the [deployment event shape](/reference/integrations/automate/triggers/on-deployment-event) with `status: "cancelled"` and a populated `deployment.completedAt`.
