> ## Documentation Index
> Fetch the complete documentation index at: https://explore.airia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Notion

> Create and read Notion pages, read databases, and search your workspace from inside an agent workflow.

Notion actions let an agent work with your workspace directly in a flow. An agent can create and read pages, read databases, and search the workspace, then pass the results to later steps.

## Supported actions

| Group        | Actions     |
| ------------ | ----------- |
| **Page**     | Create, Get |
| **Database** | Get         |
| **Search**   | Search      |

## Prerequisites

<AccordionGroup>
  <Accordion title="Create a Notion credential" icon="key">
    Connect Notion through OAuth, or store a Notion integration secret. Save either as a **Notion** credential in [Credential Management](/admin-hub/account_settings/credential-management). Select that credential on every Notion action. These actions also support end user authentication, so a step can act on each user's own connected workspace.
  </Accordion>
</AccordionGroup>

## How to use these actions

* **Map text inputs from earlier steps.** Inputs such as **Query** and the JSON fields accept a value mapped from a previous step.
* **Page Size takes a fixed value.** Enter **Page Size** as a fixed value.
* **Create a page under a database or another page.** Supply either a **Parent Database ID** to create the page inside a database, or a **Parent Page ID** to create it under another page.
* **Properties and children are JSON.** Page properties and block children are provided as JSON.
* **List and search results page with a cursor.** Pass the **Start Cursor** to page through more results.

## Actions

### Page

#### Notion Page Create

Creates a new page.

<Note>You must supply either a **Parent Database ID** or a **Parent Page ID**.</Note>

| Input                  | Required    | Description                                                                    |
| ---------------------- | ----------- | ------------------------------------------------------------------------------ |
| **Parent Database ID** | Conditional | The database to create the page inside. Provide this or **Parent Page ID**.    |
| **Parent Page ID**     | Conditional | The page to create the new page under. Provide this or **Parent Database ID**. |
| **Properties JSON**    | Yes         | The page properties as JSON.                                                   |
| **Children JSON**      | No          | The block children as JSON.                                                    |
| **Icon**               | No          | An emoji or an external URL.                                                   |
| **Cover URL**          | No          | A cover image URL.                                                             |

#### Notion Page Get

Retrieves a page by ID.

| Input       | Required | Description                                    |
| ----------- | -------- | ---------------------------------------------- |
| **Page ID** | Yes      | The unique identifier of the page to retrieve. |

### Database

#### Notion Database Get

Retrieves a database by ID.

| Input           | Required | Description                                        |
| --------------- | -------- | -------------------------------------------------- |
| **Database ID** | Yes      | The unique identifier of the database to retrieve. |

### Search

#### Notion Search

Searches your workspace for pages and databases.

| Input                  | Required | Description                                             |
| ---------------------- | -------- | ------------------------------------------------------- |
| **Query**              | No       | The search text to match.                               |
| **Filter Object Type** | No       | Limit results to one type, either `page` or `database`. |
| **Sort Direction**     | No       | The sort direction, either `ascending` or `descending`. |
| **Sort Timestamp**     | No       | The timestamp to sort by, `last_edited_time`.           |
| **Page Size**          | No       | Maximum number of results to return, from 1 to 100.     |
| **Start Cursor**       | No       | Pagination cursor. The cursor to start from.            |

## Example

An agent that logs a meeting summary to a Notion database:

<Steps>
  <Step title="Find the database">
    A **Notion Search** action with **Filter Object Type** set to `database` lets a model step confirm the target database ID.
  </Step>

  <Step title="Create the page">
    A **Notion Page Create** action sets **Parent Database ID** to that database and maps **Properties JSON** to the meeting title, date, and owner, with the summary supplied through **Children JSON**.
  </Step>

  <Step title="Confirm">
    A model step summarizes the created page, including its returned identifier, for the activity log.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Authentication failed" icon="lock">
    Confirm the stored secret or OAuth connection is valid and has not been revoked. Reconnect Notion or update the credential.
  </Accordion>

  <Accordion title="Object not found" icon="circle-question">
    The **Page ID** or **Database ID** does not exist, or the integration has not been shared with that page or database. In Notion, share the page or database with your integration, then retry.
  </Accordion>

  <Accordion title="Missing parent on Page Create" icon="triangle-exclamation">
    A page must have a parent. Supply either a **Parent Database ID** or a **Parent Page ID**, but not both.
  </Accordion>

  <Accordion title="Invalid properties or children JSON" icon="brackets-curly">
    **Properties JSON** and **Children JSON** must be valid JSON that matches the Notion structure for the parent. Confirm property names match the database schema.
  </Accordion>
</AccordionGroup>

For issues common to every vendor, see the [Actions overview](/building-and-deploying-agents/agent-basics/actions/overview#troubleshooting).
