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

# Update Notion page markdown

> Insert, replace, or update page content through Notion's markdown API.

`notion.updatePageMarkdown` insert, replace, or update page content through Notion's markdown API.

## Example

```ts automations/notion-update-page-markdown.automation.ts theme={null}
import { automation, onSchedule } from "automate.ax"
import { notion } from "automate.ax/notion"

export default automation("Update Notion page markdown", () => {
  onSchedule({ schedule: "0 9 * * *" })

  notion.updatePageMarkdown({
    page_id: "page-id",
    type: "insert_content",
    insert_content: { content: "## Update" },
  })
})
```

## Inputs

Provide `page_id` and exactly one discriminated operation: `insert_content`, `replace_content_range`, `update_content`, or `replace_content`. Mixed operation bodies fail before execution, and `insert_content` cannot provide both `after` and `position`. Set `allow_async` for a background update; markdown is governed by Notion's 500 KB request limit rather than the 2,000-character rich-text limit. Every input accepts a compatible signal, and an optional second argument can select a named account.

## Output

Returns the updated `page_markdown` object with completeness metadata for a synchronous request. An asynchronous update returns an `async_task`; pass its `id` to `getAsyncTask` and respect `poll_after_seconds` while it is pending.
