Notion Wiki to SharePoint Mirror
On a schedule, the flow mirrors pages from a Notion knowledge/wiki database into a SharePoint document library, converting Notion content to HTML and keeping metadata (owner, category, last-updated) in sync. It removes SharePoint entries when a Notion page is archived, giving Microsoft-governed search and retention over Notion-authored knowledge.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow mirrors a Notion knowledge/wiki database into a SharePoint document library so Notion-authored knowledge is covered by Microsoft 365 search, retention, and eDiscovery. On a daily schedule it reads every page in the wiki database, converts each page's blocks to a branded HTML document, and writes it to SharePoint. A Dataverse ledger table tracks each mirrored page (Notion page id, last-edited timestamp, SharePoint item id, status) to provide change detection (only re-mirror pages that changed), de-duplication, and archive handling - when a page disappears from Notion the flow deletes its SharePoint mirror and marks the ledger row Archived. A summary email is sent after each run.
Why it matters: Knowledge authored in Notion sits outside Microsoft governance. A scheduled, metadata-preserving mirror gives compliance and search teams a governed SharePoint copy without forcing authors off Notion.
Built and shipped Off (demo). Going live requires only authorizing the four connections, setting the environment variable values, and turning the flow On.
Use Case
A team authors documentation in a Notion wiki, but the organization requires that knowledge be searchable and retained in SharePoint/Microsoft 365. They want an automatic mirror that keeps content and metadata in sync and cleans up removed pages, without manual copy-paste.
Flow Architecture
Recurrence
Recurrence (Day/1)Daily mirror cadence (configurable)
Initialize variables
Initialize Variable x12Correlation id (guid), DB id, title/category property names, site URL, library path + GUID, notify email, counters, active-page-id array, summary HTML
Query Notion Wiki Database
Notion Query_a_databaseReturns all pages in the wiki database
Apply to each Page
Foreach (sequential)Extract id/title/last-edited/category, record active page id, read blocks
Get Page Content Blocks
Notion Retrieve_block_childrenReads the page body blocks
Build Page HTML
Select + ComposeMaps each block to an HTML paragraph and assembles the branded HTML document
List Ledger Match + Condition New Or Changed
Dataverse ListRecords + IfTrue when the page is new or its last_edited_time differs from the ledger
Create Mirror File
SharePoint CreateFileWrites {pageId}.html to the mirror library
Create / Update Ledger Row
Dataverse CreateRecord / UpdateRecordPersists mirror state and increments the mirrored counter
Archive sweep
Dataverse ListRecords + Foreach + SharePoint DeleteItemRemoves orphaned SharePoint files and marks ledger rows Archived for pages no longer in Notion
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_NotionWikiDatabaseId | String | (set per tenant) | Source Notion wiki/knowledge database id |
| flowlibs_NotionTitleProperty | String | Name | Notion title property name |
| flowlibs_NotionWikiCategoryProperty | String | Category | Notion select property used as page Category |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | SharePoint site URL |
| flowlibs_MirrorLibraryPath | String | /Shared Documents/Notion Wiki Mirror | Server-relative folder path for mirror files (CreateFile) |
| flowlibs_MirrorLibraryGuid | String | (set per tenant) | SharePoint library list GUID (required for DeleteItem) |
| flowlibs_MirrorNotifyEmail | String | alerts@yourcompany.com | Run-summary email recipient |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Notion | shared_notionip | Query_a_database Retrieve_block_children |
| SharePoint | shared_sharepointonline | CreateFile DeleteItem |
| Microsoft Dataverse | shared_commondataserviceforapps | ListRecords CreateRecord UpdateRecord |
| Office 365 Outlook |
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Cadence
- Change the Recurrence frequency/interval (default Day/1) to mirror more or less often.
- Selective mirror
- Add a Filter array after Query Notion Wiki Database to mirror only pages with a given status/tag (e.g. Approved/Public).
- Richer HTML
- Extend Select Block Html to map more Notion block types (headings, lists, code) instead of paragraphs only.
- Attachments
- For embedded files, add a Notion file read + a second SharePoint CreateFile and relink in the HTML.
- Retention labels
- To apply a real Microsoft Purview label, add a SharePoint REST SetComplianceTag (or Graph) HTTP call after CreateFile; the connector has no label op.
- Notify target
- Point flowlibs_MirrorNotifyEmail at a distribution list, or swap the Outlook step for Teams.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Page title (dynamic property key)
Reads the configured title property
EXPR.02Category metadata
Reads the configured category select
EXPR.03Block -> HTML paragraph (Select map)
Maps a Notion block to an HTML paragraph
EXPR.04New-or-changed test
Re-mirror only new or changed pages
EXPR.05Archive test
Ledger page no longer present in Notion
EXPR.06Ledger record id for update
Primary key of the existing ledger row
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.