Docs / Notion

Notion setup

One place for everything about the Notion side of an instance: what the CRM in Notion consists of, which fields each database has, how to connect it, how to build it in a fresh teamspace.

You want Read
Every database and every field, with type, writer and options fields.md (generated; do not edit)
What a module is for, its rules, its views, the Help page tree the knowledge pack: app/projects/_template/notion-crm/, files 00 to 11
The machine-readable contract (types, options, relations, view filters) the pack's schema/<db>.json and views/<db>.json
How an agent deploys it skills/notion-project-deploy/SKILL.md and ../core/15-notion-project-deploy-skill.md

The pack is a snapshot of one live CRM (📘 Help), distilled and made generic. Notion wins where they disagree; refresh the pack when the live Help's Changes list grows.

Set Notion up for an instance

  1. Teamspace. Make a teamspace for the project (or pick a parent page). Record its name in projects/<slug>/project.md as notion.teamspace, or a page id as notion.parent_page (it wins).
  2. Access. The Claude Notion connector (no token) is what a session writes with; the hub's read integration (a token, shared with the whole teamspace) is what the local app, notion-dump and the doctor read with. Which credential goes to what, and what to share: ../setup/access.md.
  3. Build the databases. ./run.sh project setup <slug> interviews you once; when the project's Notion has no databases it hands over to the notion-project-deploy skill. That skill makes a dry-run plan (CREATE / ADD / SKIP / exists), creates nothing until you say go, never deletes and never touches rows, and writes each data source id back into project.md under ## Notion databases.
  4. Check. ./run.sh doctor <slug> runs notion.access, which reads every database through the integration and names each one it cannot reach. All 404 means the integration sees none of the teamspace: share it again, see ../setup/access.md.

Core modules: Clients, Leads, Tasks, Documents (conversation reports are Documents of Type Report; the separate Reports database is retired, decision 0022; a CRM may still name Documents' relation to Clients People, and the skills find it by its target, not its name) and Bug reports (P145, decision 0054: required by no kind, created by hub install --only notion.bug-reports beside Clients and listed in project.md as bug-reports). Workflows are not a Notion module: they are files in the project folder (projects/<slug>/workflows/, hub workflows list <slug>). Optional: Deals, Expenses and Payments, Business contacts, Knowledge, and the legacy module sales-legacy (Organizations, Open loops): kept where a project has live rows, never read or written by the Hub; notion.access warns, never fails, about an archived one. Participants left the pack on 2026-11-25.

One project key (P145, decision 0053)

Clients, Documents, Business contacts, Tasks, Expenses and Bug reports carry the project as the multi_select Projects, one option per project key; Leads keeps Brand, the integration-written fact of which site a lead came from, with the same options. The key of a name is its lower case with everything but letters and digits dropped, so the options keep the human names (Caribbean MLS) and a site's slug (caribbean-mls) matches them. Clients' Projects is confirmed membership (the agent and people, on evidence; the Hub on a card it creates or links to a lead), and Project signals is a formula nobody writes (Projects, the Brand of linked Leads, an import key or a Lead source); the per-project views filter on it, and Project unknown is both empty. hub install --only notion.projects adds a brand's missing option and never removes one; hub doctor --only notion.project-keys prints each brand, its key and the options it matched. An older CRM's Business contacts Brand is renamed Projects in Notion: the Hub reads only Projects. A property flagged vertical (real estate) or ads is built only if the interview asks for it.

Telegram and WhatsApp on a client

Clients has two fields for messengers, next to Phone, both edited by people (P84). The Hub reads them to link the owner's messenger chats to the right client by itself (Messengers ▸ Chats; project setting messengers.autolink); nothing else uses them. The Hub writes one of them only on the owner's click (P100): when he links a chat to a client whose field is empty, the chat's username or number goes in, and when he creates a client from a chat; a filled field is never overwritten.

+E.164 means +, the country code, then the number, without the leading 0 of a local number. A number written without its country code (0812...) is skipped: the Hub never guesses the country. A chat links only when exactly one client with an Email matches; a number two clients share links nothing and shows as a suggestion instead, and a contact's saved name never counts. Field descriptions, word for word: fields.md.

How one person is identified across Mail, Telegram, WhatsApp and Notion

One person is one Clients page, and its identity keys are fields on it: Email (and Other emails) for Mail, Telegram (username, or +E.164) for Telegram, WhatsApp or Phone (+E.164) for WhatsApp. The Hub's own clients row is keyed by the Email, so a chat links only to a page with an Email. Messengers ▸ Chats' Link to a client searches all of these keys (name, email, @username, phone, in any spacing) in the copy of Clients the server reads at start and every 6 hours and, at the same time, in Notion itself, so a page made a minute ago is found. Nothing matches: Create client makes the page there (Name, Email, Relationship Lead, the chat's username or number) and links the chat. Once a page carries the chat's key, the next chat from that person links by itself (messengers.autolink on). A link loads the chat's last 30 days once (at most 500 messages); later messages arrive live.

Rules that matter

Changing the schema

Edit schema/<db>.json in the pack (and the matching markdown rule), run pnpm hub docs, commit both. The installer test fails when fields.md is out of date.

Update this page when the architecture changes.

Source: @docs/notion/README.md