DEV Community

Pirate Prentice
Pirate Prentice

Posted on

n8n Notion Node: Read, Create, Update, and Search Database Pages (+ Free JSON)

If you manage projects, content, or customer data in Notion, the n8n Notion node lets you automate every interaction — no manual copy-paste, no Zapier fees, no code required.

This guide covers everything: connecting Notion to n8n, understanding the node's operations, reading and creating database pages, filtering queries, updating properties, and common gotchas. A free workflow JSON is included at the end.

Prerequisites

  • n8n (self-hosted or cloud)
  • A Notion account with at least one database
  • A Notion integration token (we'll create one below)

Step 1: Create a Notion Integration

  1. Go to https://www.notion.so/my-integrations
  2. Click + New integration
  3. Give it a name (e.g., "n8n Automation")
  4. Select the workspace
  5. Set capabilities: Read content, Update content, Insert content — enable all three
  6. Click Submit
  7. Copy the Internal Integration Token (starts with ntn_ or secret_)

⚠️ The token only has access to pages you explicitly share with it. Don't forget Step 2.

Step 2: Share Your Database with the Integration

  1. Open your Notion database
  2. Click ... (top-right) → Add connections
  3. Search for your integration name and select it
  4. Click Confirm

Without this step, every API call returns a 404 — even with a valid token.


Step 3: Add the Credential in n8n

  1. In n8n, go to Credentials → New
  2. Search for Notion API
  3. Paste your Internal Integration Token
  4. Save and test — you should see "Connection tested successfully"

The n8n Notion Node: Operations Overview

The Notion node has two resource types:

Resource Operations
Database Page Create, Get, Get Many, Update
Block Append, Get Children

For most automation use cases, you'll live in Database Page.

Operation: Get Many (Query a Database)

This is your go-to for reading data — it's the equivalent of Notion's "Filter" view.

Required fields:

  • Database ID: The 32-character ID from your database URL
    • URL pattern: notion.so/[workspace]/[DATABASE_ID]?v=...
    • Or share the page and copy the last segment before ?

Finding the Database ID:

https://www.notion.so/myworkspace/abc123def456789012345678901234ab?v=xyz
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                  This 32-char string is your Database ID
                                  (n8n also accepts dashes: abc123de-f456-7890-1234-5678901234ab)
Enter fullscreen mode Exit fullscreen mode

Filters:
Click Add Filter to narrow results:

{
  "property": "Status",
  "select": {
    "equals": "In Progress"
  }
}
Enter fullscreen mode Exit fullscreen mode

Common filter types by property:

Property type Filter key Example value
Text / Title rich_text {"contains": "invoice"}
Select select {"equals": "Done"}
Checkbox checkbox {"equals": true}
Date date {"on_or_after": "2026-01-01"}
Number number {"greater_than": 100}
Multi-select multi_select {"contains": "Marketing"}

Compound filters (AND/OR):
Use the Add Compound Filter option or pass raw JSON:

{
  "and": [
    { "property": "Status", "select": { "equals": "In Progress" } },
    { "property": "Priority", "select": { "equals": "High" } }
  ]
}
Enter fullscreen mode Exit fullscreen mode

Return All vs. Limit:

  • Toggle Return All on to paginate automatically (Notion returns max 100 per page)
  • Leave it off and set Page Size for explicit limits

Sort:
Add sorts under the Sort section:

[
  { "property": "Due Date", "direction": "ascending" }
]
Enter fullscreen mode Exit fullscreen mode

Operation: Get (Single Page)

Fetch one page when you already have the Page ID.

Page ID: Same format as Database ID — 32 hex chars. You get these from:

  • A "Get Many" node's output ({{ $json.id }})
  • The page's URL
  • A webhook payload from Notion (if you're using Notion's webhook beta)

Operation: Create

Add a new row to a Notion database.

Required:

  • Database ID
  • At least one property value (usually the Title / Name column)

Mapping properties:

Click Add Property and match property names exactly as they appear in your database:

Notion property type n8n field type to select
Title Title
Text Rich Text
Select Select
Multi-select Multi Select
Date Date
Checkbox Checkbox
Number Number
URL URL
Email Email
Phone Phone Number
Relation Relation

⚠️ Common gotcha: Property names are case-sensitive and must match exactly. "name" ≠ "Name".
Example: Create a page with Title + Status + Due Date

In the n8n UI:

  1. Resource: Database Page
  2. Operation: Create
  3. Database ID: your-database-id
  4. Add Property: Name (Title) → {{ $json.task_name }}
  5. Add Property: Status (Select) → In Progress
  6. Add Property: Due Date (Date) → {{ $json.due_date }}

Operation: Update

Change properties on an existing page. Requires the Page ID.

  • Only the properties you specify are changed; everything else stays as-is
  • To clear a value, set it to an empty string or null depending on the type
  • To archive a page (equivalent to "delete" in Notion), enable the Archive toggle

Archiving a page:
Turn on the Archive toggle in the Update operation. This moves the page to trash in Notion — it's the closest thing to deletion the API supports.


Blocks: Append Block Children

Use this to add content inside a page (paragraphs, headings, bullets, code blocks) rather than just updating properties.

Use case: You've created a page record (database row), and now you want to write a summary, meeting notes, or AI-generated content into the page body.

Block types supported:

  • paragraph
  • heading_1, heading_2, heading_3
  • bulleted_list_item
  • numbered_list_item
  • to_do
  • code
  • quote
  • divider

Example block JSON:

[
  {
    "object": "block",
    "type": "heading_2",
    "heading_2": {
      "rich_text": [{ "type": "text", "text": { "content": "Summary" } }]
    }
  },
  {
    "object": "block",
    "type": "paragraph",
    "paragraph": {
      "rich_text": [{ "type": "text", "text": { "content": "{{ $json.ai_summary }}" } }]
    }
  }
]
Enter fullscreen mode Exit fullscreen mode

Common Patterns

Pattern 1: Form → Notion Database

Webhook (Typeform/Tally) → Set node (map fields) → Notion Create

Ideal for: lead capture, application intake, event registrations.

Pattern 2: Notion → Email Digest

Schedule Trigger (daily 8am) → Notion Get Many (filter: Status = "In Progress", Due Date = today) → Loop → Gmail/Resend (send row as email)

Ideal for: daily standup digest, task reminders.

Pattern 3: Update Notion from External Event

Webhook (Stripe payment) → Notion Get Many (filter: Email = {{ $json.email }}) → IF (found?) → Notion Update (set Status = "Paid")

Ideal for: syncing payment status, order fulfillment tracking.

Pattern 4: AI Enrichment Pipeline

Notion Get Many (filter: AI Summary is empty) → OpenAI (summarize) → Notion Update (write summary back) + Notion Append Block (add body content)

Ideal for: auto-generating summaries, research notes, content briefs.


Gotchas & Fixes

Problem Cause Fix
404 on every call Database not shared with integration Share the database with your integration (Step 2)
"Could not find database" Wrong Database ID format Remove dashes or use the 32-char hex string directly
Property not updating Name mismatch (case-sensitive) Copy property name exactly from Notion
Date not saving Wrong format Use ISO 8601: 2026-06-28 or 2026-06-28T09:00:00Z
Relation not linking Wrong page ID format Use the 32-char page ID without dashes for relation fields
"Insufficient permissions" Integration lacks capability Re-check integration capabilities at notion.so/my-integrations
400 on checkbox Sending string "true" Send boolean true, not the string
Archived pages appear in queries Default filter includes archived Add filter: "is_not_empty" on a key property, or use archived: false

Free Workflow JSON: Notion Task Digest

This workflow runs every morning at 8am, queries a Notion database for tasks due today, and sends you an email summary.

Setup:

  1. Import the JSON into n8n (Settings → Import Workflow)
  2. Set your Notion Database ID in the Notion node
  3. Set your email in the Gmail/Resend node
  4. Activate
{
  "name": "Notion Daily Task Digest",
  "nodes": [
    {
      "parameters": { "rule": { "interval": [{ "field": "hours", "hoursInterval": 24 }] } },
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1,
      "position": [240, 300]
    },
    {
      "parameters": {
        "resource": "databasePage",
        "operation": "getAll",
        "databaseId": "YOUR_DATABASE_ID_HERE",
        "returnAll": true,
        "filterType": "json",
        "filterJson": "{\"and\":[{\"property\":\"Due Date\",\"date\":{\"equals\":\"{{ $now.toISO().substring(0,10) }}\"}},{\"property\":\"Status\",\"select\":{\"does_not_equal\":\"Done\"}}]}"
      },
      "name": "Get Today Tasks",
      "type": "n8n-nodes-base.notion",
      "typeVersion": 2,
      "position": [460, 300]
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nif (items.length === 0) return [{ json: { subject: 'No tasks due today', body: 'Your Notion board is clear for today.' } }];\nconst lines = items.map(i => `- ${i.json.properties?.Name?.title?.[0]?.plain_text ?? 'Untitled'}`);\nreturn [{ json: { subject: `Today's Tasks (${items.length})`, body: lines.join('\\n') } }];"
      },
      "name": "Build Digest",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [680, 300]
    },
    {
      "parameters": {
        "sendTo": "you@example.com",
        "subject": "={{ $json.subject }}",
        "message": "={{ $json.body }}",
        "options": {}
      },
      "name": "Send Email",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2,
      "position": [900, 300]
    }
  ],
  "connections": {
    "Schedule Trigger": { "main": [[{ "node": "Get Today Tasks", "type": "main", "index": 0 }]] },
    "Get Today Tasks": { "main": [[{ "node": "Build Digest", "type": "main", "index": 0 }]] },
    "Build Digest": { "main": [[{ "node": "Send Email", "type": "main", "index": 0 }]] }
  }
}
Enter fullscreen mode Exit fullscreen mode

Want more pre-built n8n workflow packs? I sell done-for-you workflow JSON bundles on Gumroad — automation patterns for lead capture, Stripe payments, email sequences, and more. Each pack includes documented JSON + setup walkthrough.


Summary

  • Get Many: query with filters + sorts — your primary read operation
  • Get: fetch a single page by ID
  • Create: add a new database row with typed property values
  • Update: modify specific properties on an existing page (by page ID)
  • Append Block Children: write content inside a page body
  • Share your database with the integration before any API call
  • Property names are case-sensitive; Database IDs can include or omit dashes
  • Use the Code node to build digest text, conditional logic, or dynamic filter JSON

The Notion node pairs especially well with the HTTP Request node for anything not natively supported, and with the AI Agent node for enrichment pipelines.

Top comments (0)