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

# Abort Actor run

> Stops a running Apify Actor run immediately or gracefully.

`apify.abortRun` stops a running Apify Actor run immediately or gracefully.

## Example

```ts automations/apify-abort-run.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { apify } from "automate.ax/apify"

export default automation("Abort Actor run", () => {
  onHttpRequest({ scope: "automation" })

  apify.abortRun({ runId: "run-id", gracefully: true })
})
```

## Inputs

`runId` identifies the run. Set `gracefully` to `true` to let the Actor handle its abort signal before Apify stops it; the provider default is an immediate abort.

## Output

Returns the updated Actor run.

Aborting changes provider state and may be unsafe to repeat after an uncertain response.
