> ## 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 document updated

> Run an automation when Convex updates a document.

`convex.onDocumentUpdated` watches one table and starts the automation when an existing document receives a new revision.

```ts automations/changed-convex-message.automation.ts theme={null}
import { automation } from "automate.ax"
import { convex } from "automate.ax/convex"

export default automation("Changed Convex message", () => {
  const event = convex.onDocumentUpdated({ table: "messages" })
  // Sync the updated Convex document to the search index.
})
```

Options are `table`, optional `component` (default `""`), optional OAuth `deployment` (default `prod`), and optional `account`. Trigger data includes the current `document`, `documentId`, `revision`, `table`, `component`, and `action: "updated"`.

This trigger requires Convex Pro Data Sync and `deployment:data:view`. It reports the current document, not a field-level diff.
