> ## 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 action failed

> Run an automation when another action reaches a certain terminal failure.

`automate.onActionFailed` uses the [action-attempt event payload](/reference/integrations/automate/triggers/on-action-attempt-event) with `attempt.status: "failed"`, `action.status: "failed"`, and normalized `failure`.

```ts automations/on-action-failed.automation.ts theme={null}
import { automation } from "automate.ax"
import { automate } from "automate.ax/automate"

export default automation("Action failed", () => {
  const event = automate.onActionFailed({ automation: "auto_123" })
  // Notify an owner about the failed Automate.ax action.
})
```

`automation` accepts an imported automation descriptor, exact ID, or unique deployed description. When `account` is omitted, the trigger uses the deploying project's organization. An explicit static Automate.ax binding requires `project:read` and can watch another organization.
