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

# Query Notion session events

> Query the ordered events emitted within an agent session.

`notion.querySessionEvents` query the ordered events emitted within an agent session.

## Example

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

export default automation("Query Notion session events", () => {
  onSchedule({ schedule: "0 9 * * *" })

  notion.querySessionEvents({ session_id: "session-id", page_size: 50 })
})
```

## Inputs

`session_id` is required. Optional filters, sorts, cursor, and page size narrow the event stream. Every input accepts a compatible signal, and an optional second argument can select a named account.

## Output

Returns a paginated `session_event` list with typed user messages, agent messages, tool activity, and other documented variants.
