đź“– Audit Notion wiki health and send weekly digests to Slack

⚡ 1 views · 📖 Internal Wiki & Knowledge Base

Description

Quick overview

This workflow runs every Monday to audit a Notion wiki by crawling page content, building an internal link graph, and scoring pages for orphaned, stale, thin, and unreachable Notion mentions, then writing results to a Notion “Wiki Health” database and posting a ranked weekly digest to Slack.

How it works

  1. Runs every Monday at 7:00 AM and loads audit settings such as the wiki search text, thresholds, weights, the Notion “Wiki Health” database ID, and the Slack channel ID.
  2. Searches Notion for pages matching the configured text (or all accessible pages) and iterates through each result.
  3. Fetches each page’s blocks recursively from Notion, then extracts outbound Notion page links (mentions, link-to-page blocks, child pages, and pasted notion.so URLs) and counts words.
  4. Builds a wiki link graph to compute inbound link counts, flags pages as orphan/stale/thin (and detects unreachable mentions), and assigns a weighted health score.
  5. Filters to pages with a non-zero score, matches them to existing rows in the Notion “Wiki Health” database by Page ID, and updates or creates the corresponding database entries.
  6. Ranks the highest-scoring pages and posts a single Slack message summarizing totals and the worst offenders.

Setup

  1. Add Notion API credentials for an internal integration and share the wiki pages (and the “Wiki Health” database) with the integration so it can search pages and read blocks.
  2. Create a Notion “Wiki Health” database with properties that match what the workflow writes (including Page ID, Page URL, Status, Score, Word Count, Inbound Links, Broken Links, and Last Audited).
  3. Add Slack API credentials with permission to post messages and invite the Slack app/bot to the target channel.
  4. In the workflow configuration, set the wiki search text (optional), the “Wiki Health” database ID, and the Slack channel ID, and adjust thresholds/weights (stale days, thin word count, digest size) as needed.

Requirements

Customization

Additional info

Two node settings silently break this workflow and neither fails loudly. Get Page Blocks From Notion must keep simplifyOutput off, because simplified output flattens rich text into a plain string and drops the page IDs inside mentions, which empties the link graph and makes every page in the wiki read as an orphan. Search Wiki Pages In Notion must keep simple off for the same class of reason: simplified output returns only id, name and url with no last_edited_time, so nothing is ever stale. Both are already off in the template and should stay that way. Two smaller things worth knowing: a page the integration cannot read is labelled Fetch failed and skips the orphan and thin checks, so a permissions gap never gets reported as an abandoned page, and nothing here calls a model, so every classification is a threshold you set and the same wiki produces the same result on every run.

đź”— Nodes Used

Slack, Notion, Schedule Trigger, Filter

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup