DEV Community

Zain K.
Zain K.

Posted on

Notion + Twilio + WhatsApp = Give me what I want now

Notion MCP Challenge Submission 🧠

Cortana: WhatsApp Command Center for a Notion Workspace

What I Built

Cortana is a WhatsApp-to-Notion command center. You text a message from your phone, and Cortana:

  • Classifies the intent into one of 6 life domains (Blueprint)
  • Searches the matching knowledge in my Notion workspace
  • Replies back in WhatsApp with the domain + relevant pages

The 6 Blueprint domains:

  • Personal β€” identity, contacts, legal, finance, assets
  • Health β€” medical, fitness, medications, providers
  • Projects β€” code, hackathons, creative work
  • Work β€” employers, applications, consulting
  • Growth β€” learning, writing, AI exploration
  • Systems β€” archives, exports, logs, normalization

How It Works

flowchart LR
    A[WhatsApp message] --> B[Twilio webhook]
    B --> C[Cloudflare Worker adapter]
    C --> D[Notion Worker: classifyAndRespond]
    D --> E[Notion API search]
    E --> F[Formatted WhatsApp reply]
Enter fullscreen mode Exit fullscreen mode

Request flow:

  1. WhatsApp message arrives in Twilio
  2. Twilio calls my Cloudflare Worker webhook
  3. The adapter forwards into a Notion Worker tool (classifyAndRespond)
  4. The tool classifies the message into a Blueprint domain and runs a Notion workspace search
  5. The results are formatted and returned to Twilio
  6. Twilio replies back to WhatsApp

The Stack

  • Notion Workers (alpha) β€” worker tool runtime
  • Cloudflare Workers β€” Twilio webhook adapter
  • Twilio WhatsApp API β€” message ingestion and reply
  • Notion API (@notionhq/client) β€” workspace search
  • TypeScript β€” end-to-end

How I Used Notion MCP

Notion is the system of record for this project:

  • My workspace is organized into the Blueprint taxonomy (Personal, Health, Projects, Work, Growth, Systems)
  • Cortana uses that structure to classify and retrieve the right information instead of doing a generic search
  • Notion AI was used to structure planning artifacts and build documentation during development

Demo


  • A WhatsApp question
  • The returned domain classification
  • A few matched Notion pages

The Build Story (key blocker + fix)

I hit a repeated deploy failure while using the Notion Workers CLI:

error: Failed to create worker: unauthorized
hint: run ntn login to authenticate
Enter fullscreen mode Exit fullscreen mode

Login succeeded, but deploy kept failing. Root cause: a macOS Keychain issue where the CLI stored tokens but couldn’t reliably read them during deploy.

Fix:

export NOTION_API_TOKEN=$(security find-generic-password -s "notion-cli" -a "WORKSPACE_ID" -w)
export NOTION_WORKSPACE_ID=WORKSPACE_ID
ntn workers deploy
Enter fullscreen mode Exit fullscreen mode

After that: Notion Worker deployed, Cloudflare adapter deployed, Twilio wired up, and messages round-tripped end-to-end.

What’s Next

  • Domain-filtered search (restrict search to a specific Blueprint domain)
  • triageBacklog (inbox triage and prioritization)
  • dispatchBlueprint (create new pages/rows directly into the right domain)
  • Multi-turn context (track conversation threads)
  • Move off Twilio sandbox to a real WhatsApp number

Links

Top comments (0)