Ingest Notion pages, database entries, and comments into CortexDB.

Notion Connector

Captures Notion page and database content as CortexDB experiences. Notion API polling on a configurable cadence.

Info

Two ways to run this connector:

  • Run it yourself (Free + paid) — pip install 'cortexdb-connectors[notion]' then cortexdb-sync sync notion. The connector reads your token from ~/.cortexdb/state.json (written by cortexdb init) or from env vars.
  • Managed sync (Starter and up) — CortexDB runs the connector as a worker on its infrastructure. Configure it once from your dashboard; CortexDB handles webhook registration, retries, backfill, and idempotency.

1. Prepare credentials in Notion

Notion → Settings → Integrations → Develop your own integrations → New integration. Grant read access to the target pages/databases by explicitly sharing them with the integration. Copy the integration secret (secret_…).

2. Configure in your CortexDB dashboard

  1. Sign in at cortexdb.ai/login.
  2. Settings → Connectors → Add Connector → Notion.
  3. Paste the integration secret.
  4. Optionally restrict to specific databases or pages (comma-separated IDs). Default: every page/database that's been shared with the integration.
  5. Set the scope template. Default: org:<your-org>/source:notion/db:{database_id}.
  6. Click Start sync.

What gets written

EventModalityNotes
Page created/updateddocumentTitle + rich-text body → Markdown
Database entry created/updateddocumentProperties → labels; body as content
Commentconversationrole=user; preceded_by links to page

idempotency_key shape: notion:<page_id>:<last_edited_time>.

Run it yourself

If you'd rather host the connector yourself instead of using CortexDB's managed worker, every connector ships in the cortexdb-connectors PyPI package:

pip install 'cortexdb-connectors[notion]'

# Step 1: get a CortexDB token + actor (one-time, free tier)
pip install cortexdb-cli
cortexdb init

# Step 2: supply the connector's third-party credentials
export NOTION_TOKEN=...                # required

# Step 3: one-shot sync, or `watch` for a poll loop
cortexdb-sync sync notion
cortexdb-sync watch notion --interval 60

cortexdb-sync reads your CortexDB token + actor from ~/.cortexdb/state.json automatically. Cursor state is persisted in ~/.cortexdb/connectors-state.json, so re-running picks up where the last cycle left off.

See also