> ## 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 Access certificate expiring

> Runs when a Cloudflare Access custom certificate approaches expiration.

`cloudflare.onAccessCertificateExpiring` runs when a Cloudflare Access custom certificate approaches expiration. Automate.ax creates the generic webhook destination and notification policy, verifies `cf-webhook-auth`, and removes managed resources when the deployment no longer subscribes.

```ts automations/cloudflare-on-access-certificate-expiring.automation.ts theme={null}
import { automation } from "automate.ax"
import { cloudflare } from "automate.ax/cloudflare"

export default automation("On Access certificate expiring", () => {
  const event = cloudflare.onAccessCertificateExpiring({
    accountId: "account-id",
  })
  // Rotate the expiring Cloudflare Access certificate.
})
```

Optional `filters` narrow the managed Cloudflare policy. Optional `account` selects a static project account binding. Returns the normalized alert type, provider data, text, timestamp, account and policy IDs, policy name, correlation ID, and alert state when present.

<Warning>
  Cloudflare generic webhooks and individual alert types can require a paid plan
  or enabled product.
</Warning>
