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

# Create or update Notion session

> Start an agent session or send input to an existing session.

`notion.createOrUpdateSession` start an agent session or send input to an existing session.

## Example

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

export default automation("Create or update Notion session", () => {
  onSchedule({ schedule: "0 9 * * *" })

  notion.createOrUpdateSession({
    agent_id: "agent-id",
    message: "Summarize this workspace",
  })
})
```

## Inputs

Choose exactly one mode: `message`, `actions`, or `continue_from`. Action responses and continuations require `session_id`; a first message may use `agent_id`. Attachments, metadata, and prompt context apply only to documented variants. Every input accepts a compatible signal, and an optional second argument can select a named account.

## Output

Returns the current `session` state.

When status is `requires_action`, send the selected action response with the same `session_id`.
