Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ai-kb.automationanywhere.com/llms.txt

Use this file to discover all available pages before exploring further.

The Notion Toolkit lets agents and workflows interact with Notion pages and databases. It supports searching content, querying and updating database records, reading and appending page content, and creating new pages.

Prerequisites

  • A Notion account (free plan is sufficient)
  • A Notion workspace (every account has one by default)

Creating a Connection

  1. In the workflow, add a Notion toolkit step.
  2. Click Connect with Notion.
  3. Authorize the connection on the Notion consent screen and select which pages and databases to grant access to.
The toolkit can only access pages and databases that have been explicitly shared with the connection. To share content, open the page or database in Notion, click ···Connections, and add your integration. Content in the same workspace that has not been shared is not visible.

Available Tools

ToolDescription
SearchSearch across all shared pages and databases by title
List DatabasesReturn all databases the connection can access
Get DatabaseReturn the schema (column names and types) of a specific database
Query DatabaseFetch records from a database with optional filters and sorting
Get PageRetrieve the property values and metadata of a page or database record
Create PageCreate a new database record or sub-page
Update PageUpdate properties of an existing page, or archive it
Get Page ContentRead the body text (content blocks) of a page
Append ContentAdd new content blocks to the bottom of a page

Searches across all shared pages and databases, returning matches by title. Key inputs:
InputDescription
QueryThe text to search for
Filter TypeOptionally restrict to page or database. Leave blank to search both.
Page SizeNumber of results to return (default: 10, max: 100)
Referencing results in downstream steps:
  • First result’s ID: {{ step.output.results[0].id }}
Example use case: Before creating a new client record, search by the client’s name. If count is greater than 0, the client already exists — use the existing record’s id instead of creating a duplicate.

Database Actions

List Databases

Returns all databases the connection can access, with their names and IDs. Key inputs:
InputDescription
Page SizeNumber of databases to return (default: 20, max: 100)
When to use it: Run this once in a test workflow to discover your database IDs. Copy the id of the database you want and hard-code it in subsequent steps.

Get Database

Returns the schema of a specific database — its column names and property types. Key inputs:
InputDescription
Database IDThe ID of the database — from List Databases, or from the Notion URL: the segment before the ?v=
When to use it: Run this before writing Create Page or Update Page steps. It tells you the exact property names (case-sensitive) and their types, which determines the JSON format to use in the Properties field.
Get Database shows property types and names but not the available option values for Select fields. To see valid select options, open the database in Notion directly.

Query Database

Fetches records from a database with optional filtering and sorting. Key inputs:
InputDescription
Database IDWhich database to query
FilterA JSON filter object (see examples below). Leave blank to return all records.
SortsA JSON array of sort rules (see examples below)
Page SizeNumber of records to return (default: 20, max: 100)
Filter examples: Single filter — records where Status equals “In Progress”:
{
  "property": "Status",
  "select": { "equals": "In Progress" }
}
Filter by checkbox:
{
  "property": "Done",
  "checkbox": { "equals": false }
}
Filter by date — records with Due Date before a specific date:
{
  "property": "Due Date",
  "date": { "before": "2026-05-26" }
}
Combined filter with AND logic:
{
  "and": [
    { "property": "Status", "select": { "equals": "In Progress" } },
    { "property": "Done", "checkbox": { "equals": false } }
  ]
}
Sort — newest first:
[
  { "property": "Created time", "direction": "descending" }
]
Referencing results in downstream steps:
  • First result’s ID: {{ step.output.results[0].id }}
  • First result’s Status: {{ step.output.results[0].properties.Status }}
  • First result’s title: {{ step.output.results[0].title }}

Page Actions

Get Page

Retrieves the property values and metadata of a specific page or database record. Key inputs:
InputDescription
Page IDThe page ID — from the Notion URL, or from Query Database or Search results
Referencing values in downstream steps:
  • Status: {{ step.output.page.properties.Status }}
  • Title: {{ step.output.page.title }}
  • Page ID: {{ step.output.page.id }}
Example use case: A trigger fires with a page ID. Use Get Page to read the record’s current Status. If Status is “Pending”, continue the workflow — otherwise stop.

Create Page

Creates a new page — either as a record inside a database (new row) or as a child page under another page. Key inputs:
InputDescription
Parent IDThe database ID (for a new row) or page ID (for a sub-page)
Parent Typedatabase_id to add a database row, page_id to add a sub-page. Default: database_id
TitleThe page or record title as plain text
PropertiesOptional JSON object for additional field values. Keys must exactly match your database’s property names — use Get Database to confirm them.
Properties format by field type:
// Select field
{ "Status": { "select": { "name": "To Do" } } }

// Status field (Notion's built-in Status type)
{ "Status": { "status": { "name": "In Progress" } } }

// Date field
{ "Due Date": { "date": { "start": "2026-06-01" } } }

// Checkbox field
{ "Done": { "checkbox": false } }

// Number field
{ "Priority Score": { "number": 8 } }

// Rich text field
{ "Notes": { "rich_text": [{ "text": { "content": "Needs review before sending." } }] } }
Full example — creating a task row: Title: Follow up with client Properties:
{
  "Status": { "select": { "name": "To Do" } },
  "Due Date": { "date": { "start": "2026-06-01" } },
  "Done": { "checkbox": false }
}
The returned id can be passed to downstream steps to update or link to the new page.

Update Page

Updates the properties of an existing page, or archives it. Key inputs:
InputDescription
Page IDThe page to update — from Query Database, Get Page, or Search
PropertiesJSON object with only the fields you want to change (same format as Create Page). Fields not included are left unchanged.
ArchivedSet to true to archive (soft-delete) the page
Example — marking a task as done:
{
  "Status": { "select": { "name": "Done" } },
  "Done": { "checkbox": true },
  "Completed On": { "date": { "start": "2026-05-26" } }
}
Example — archiving a record: Leave Properties empty and set Archived to true. The record disappears from the database view but can be restored from Notion’s trash. Typical pattern:
  1. Use Query Database to find the record and get its id
  2. Feed that id into Update Page to change its fields

Content Actions

Get Page Content

Retrieves the content blocks inside a Notion page — paragraphs, headings, bullet lists, etc. This is separate from the page’s properties (database fields). Use this to read the body text of a document. Key inputs:
InputDescription
Page IDThe page to read content from
Page SizeNumber of blocks to return (default: 50, max: 100)
Referencing values in downstream steps:
  • First block’s text: {{ step.output.blocks[0].text }}
  • All blocks: {{ step.output.blocks }}
Example use case: Get the page content, pass all text blocks to an AI step to generate a summary, then send that summary via email or Telegram.

Append Content

Adds new content blocks to the bottom of an existing Notion page. Key inputs:
InputDescription
Page IDThe page to append content to
ChildrenA JSON array of Notion block objects to add
Example — appending a heading and a paragraph:
[
  {
    "object": "block",
    "type": "heading_2",
    "heading_2": {
      "rich_text": [{ "type": "text", "text": { "content": "Workflow Run — May 26" } }]
    }
  },
  {
    "object": "block",
    "type": "paragraph",
    "paragraph": {
      "rich_text": [{ "type": "text", "text": { "content": "3 records processed. 1 error found." } }]
    }
  }
]
Example — appending a bullet list item:
[
  {
    "object": "block",
    "type": "bulleted_list_item",
    "bulleted_list_item": {
      "rich_text": [{ "type": "text", "text": { "content": "New lead: Jane Doe — jane@example.com" } }]
    }
  }
]
Example use case: A workflow runs every morning, processes data, and appends a one-line log entry to a “Daily Log” page — building a running audit trail without creating a new page each time.

Troubleshooting

SymptomLikely CauseFix
401 UnauthorizedToken revoked or missingRe-authorize via the OAuth flow
404 Not Found on page or databaseContent not shared with connectionShare the page via ···Connections
Empty search or query resultsNothing shared with connectionShare at least one page or database
Property update silently ignoredProperty name case mismatchUse Get Database to confirm exact property names — they are case-sensitive
oauth_not_configured errorClient ID/secret not saved in Super AdminSee Notion OAuth Setup