| name | notion-core-workflow-a |
| description | Query, filter, and manage Notion databases and pages.
Use when building database queries with filters and sorts,
creating/updating pages with typed properties, or reading page content.
Trigger with phrases like "notion database query", "notion filter",
"notion create page", "notion update properties", "notion CRUD".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Grep |
| version | 1.38.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","productivity","notion"] |
| compatibility | Designed for Claude Code |
Notion Core Workflow A — Databases & Pages
Overview
Primary workflow for Notion integrations: querying databases with filters/sorts, creating pages with typed properties, updating page properties, and retrieving page content.
Prerequisites
- Completed
notion-install-auth setup
- A Notion database shared with your integration
- Understanding of your database's property schema
Authentication
Every call below uses a Client authenticated with an integration token
(process.env.NOTION_TOKEN). Token creation, secret storage, and sharing a
database with the integration are covered end-to-end in the notion-install-auth
skill — complete it first. Never hardcode the token; read it from the environment.
Instructions
The workflow is six steps. Steps 1–2 (schema + filtered query) are the skeleton
you almost always start with, shown here in full. Steps 3–6 (filter syntax by
type, page creation, updates/archive, pagination) live in
the full walkthrough so this file stays scannable.
Step 1: Retrieve Database Schema
Always inspect the schema first — property names and types drive every filter
and write. databases.retrieve returns db.properties keyed by property name.
import { Client } from '@notionhq/client';
const notion = new Client({ auth: process.env.NOTION_TOKEN });
async function getDatabaseSchema(databaseId: string) {
const db = await notion.databases.retrieve({ database_id: databaseId });
for (const [name, prop] of Object.(db.)) {
.();
(prop. === ) {
.(, prop...( o.));
}
}
db.;
}