Skip to main content

Provide real-time updates for Notion databases via webhooks with Supabase

Workflow preview

Workflow preview
100%
Provide real-time updates for Notion databases via webhooks with Supabase preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Purpose This enables webhooks for nearly realtime updates (every 5 seconds) from Notion Databases. Problem Notion does not offer webhooks. Even worse, the “Last edited time” property, we could use ...

Best for

  • Engineering automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.notion, n8n-nodes-base.if, n8n-nodes-base.supabase, n8n-nodes-base.code, n8n-nodes-base.splitinbatches, n8n-nodes-base.set, n8n-nodes-base.noop, n8n-nodes-base.aggregate

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Mario.

Original n8n.io source

1.1 Workflow description

Title
Provide real-time updates for Notion databases via webhooks with Supabase
Workflow name
Provide real-time updates for Notion databases via webhooks with Supabase

Purpose

This enables webhooks for nearly realtime updates (every 5 seconds) from Notion Databases.

Problem

Notion does not offer webhooks. Even worse, the “Last edited time” property, we could use for polling, only updates every minute. This gives us a polling interval only as low as 2 minutes and we still need to implement a comparing mechanism to detect changes.

Solution

This workflow caches states in between while doing efficient polling & comparing. It brings down the update latency from 2 minutes to 5 seconds and also provides the output of the changes only.

Demo

How it works

  • Database Pages are frequently polled while filtered by a last modified time stamp for more efficiency
  • Retrieved pages get compared with previously cached versions in Supabase
  • Only new and changed pages are pushed to a registered webhook

Setup

  • Create a new project in Supabase and import the DB schema (provided through Gumroad)
  • Add a "Last edited time" property to your Notion Database, if it has none yet
  • Define the dynamically generated settings_id from the settings table (Supabase) in the Globals node
  • Define the Notion Database URL in the Globals node
  • Define your custom Webhook URL in the last node where the results should be pushed to
  • It is recommended to call this workflow using this template to prevent simultaneous workflow executions
  • Set the Schedule Trigger to every 5 seconds or less frequent
  • More detailed instructions provided within the workflow file and the illustrated instructions provided during the download

Example output

[
  {
    "action": "changed",
    "changes": {
      "property_modified_at": "2024-06-04T17:59:00.000Z",
      "property_priority": "important"
    },
    "data": {
      "id": "ba761e03-7d6d-44c2-8e8d-c8a4fb930d0f",
      "name": "Try out n8n",
      "url": "https://www.notion.so/Try-out-n8n-ba761e037d6d44c28e8dc8a4fb930d0f",
      "property_todoist_id": "",
      "property_id": "ba761e037d6d44c28e8dc8a4fb930d0f",
      "property_modified_at": "2024-06-04T17:59:00.000Z",
      "property_status": "Backlog",
      "property_priority": "important",
      "property_due": {
        "start": "2024-06-05",
        "end": null,
        "time_zone": null
      },
      "property_focus": false,
      "property_name": "Try out n8n"
    },
    "updated_at": "2024-06-04T17:59:42.144+00:00"
  }
]

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Get modified tasks

Type / Role
n8n-nodes-base.notion - notion
Config choices
Version 2.1

Block 2 - If not exists

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 3 - Get Notion Page

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 4 - Compare Data Sets

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 5 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 6 - New and Stored Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 7 - No Operation

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 8 - Aggregate

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 9 - FormatUpdated

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 10 - FormatCreated

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 11 - Execute Workflow Trigger

Type / Role
n8n-nodes-base.executeWorkflowTrigger - executeWorkflowTrigger
Config choices
Version 1

Block 12 - Push Payload

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 13 - Remove empty entries

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2

Block 14 - Any actual changes?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2

Block 15 - Get settings

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 16 - Store settings

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 17 - Globals

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.3

Block 18 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Update Notion Page

Type / Role
n8n-nodes-base.supabase - supabase
Config choices
Version 1

Block 21 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note7

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Provide real-time updates for Notion databases via webhooks with Supabase
Complexity advanced
Nodes 29
Categories Engineering
Author Mario
Published 08 Jun 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2284/2284.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Provide real-time updates for Notion databases via webhooks with Supabase do?

Purpose This enables webhooks for nearly realtime updates (every 5 seconds) from Notion Databases. Problem Notion does not offer webhooks. Even worse, the “Last edited time” property, we could use ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering use case.