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

# Run mutation

> Run a public or internal Convex mutation.

`convex.runMutation` calls a named mutation and returns its Convex value.

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

export default automation("Create Convex message", () => {
  onSchedule({ schedule: "0 9 * * *" })
  convex.runMutation({
    functionName: "messages:create",
    arguments: { body: "Daily check-in" },
  })
})
```

## Inputs

| Input                          | Type                                              | Required | Default         | Description                                                                   |
| ------------------------------ | ------------------------------------------------- | -------- | --------------- | ----------------------------------------------------------------------------- |
| `functionName`                 | `string`                                          | Yes      | None            | Exported function path.                                                       |
| `arguments`                    | `Record<string, ConvexValue>`                     | No       | `{}`            | Convex function arguments.                                                    |
| `deployment`                   | `string`                                          | No       | `prod`          | Deployment reference for project OAuth. Omit it for a deployment-key account. |
| Second argument: `{ account }` | `string \| IntegrationAccountReference<"convex">` | No       | Project default | Connected Convex account.                                                     |

The mutation runs with the connected project token or deploy key. Prefer an internal mutation for service-only operations and grant only the run-internal permission it needs.

The selected deployment must use a hosted `.convex.cloud` URL. Automate.ax can't reach a local development deployment.
