> ## 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 Scrapfly crawl

> Cancel a pending or running Scrapfly crawler job.

`scrapfly.cancelCrawl` stops a crawler job.

```ts theme={null}
import { automation, onInvocation } from "automate.ax"
import { scrapfly } from "automate.ax/scrapfly"

export default automation("Cancel crawl", () => {
  const request = onInvocation()
  scrapfly.cancelCrawl({ crawlerId: request.input.crawlerId })
})
```

`crawlerId` is required. Returns `{ cancelled: true }` when Scrapfly accepts the request. Scrapfly treats cancellation idempotently: a completed or already-cancelled job remains a successful no-op.
