Notion Database Entry to NextCloud OneNote Sync - n8n Workflow

Use this powerful n8n workflow to automatically create and synchronize new OneNote files in NextCloud/WebDAV whenever a new entry is added to a Notion database, complete with robust locking logic.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Users who manage tasks or notes in Notion but prefer editing and storing content in OneNote (via NextCloud).
Automation developers needing advanced examples of n8n flow control using Redis locks.
Technical users managing file operations via WebDAV within an n8n workflow.
Anyone looking for complex, integrated n8n templates involving multiple cloud services.

Overview

Managing documentation across multiple platforms can be challenging. This sophisticated n8n workflow solves the problem of keeping Notion and OneNote synchronized when creating new notes. When a new entry is created in a designated Notion database, this n8n automation checks if a corresponding OneNote file exists in a structured NextCloud folder path. If the file is missing, the n8n workflow copies an 'empty.one' template to the correct location and then updates the original Notion page with a direct link to the newly created OneNote file. It employs a crucial Redis locking mechanism (using the n8n Redis node) to prevent infinite loops, ensuring the subsequent Notion update doesn't immediately re-trigger the n8n trigger webhook. This is a high-utility example of advanced n8n workflow design.

How it Works

The logical flow of this n8n workflow is tightly controlled and proceeds as follows:


  1. Trigger and Lock Check: The n8n trigger is initiated by a Webhook when a Notion page is updated or created. The very next n8n node, Redis, attempts to read a lock key associated with that Notion page ID.

  2. Debounce/Filter: The Filter node checks the Redis response. If the key value is 'Update' (meaning this n8n workflow recently processed this item), the flow stops, preventing a loop.

  3. Data Retrieval: The Get Notion page n8n node retrieves the full details of the specific Notion page.

  4. Conditional Execution: The Switch n8n node checks if the 'Notes' URL property in Notion is currently empty. The creation logic only proceeds if the URL is empty.

  5. Path Mapping: The Mapping code n8n node dynamically constructs the required NextCloud WebDAV destination path and the local OneNote link using the Notion page's Name and Subject properties.

  6. Existence Check: An HTTP Request1 n8n node performs a PROPFIND WebDAV request on the target directory path in NextCloud.

  7. File Matching: The Match titiles code n8n node parses the complex XML response from NextCloud/WebDAV to determine if a OneNote file with the exact same name already exists in that specific folder.

  8. Conditional Creation: The If n8n node branches: If the file does not exist (match=false), the flow proceeds to copy the template.

  9. File Creation & Linking: The HTTP Request n8n node (using the COPY method) duplicates an empty template file to the new destination. Following this, the Update task in Notion n8n node patches the original Notion page with the generated OneNote URL.

  10. Lock Setting: Finally, the Store Redis n8n node sets the lock key to 'Updated' with an 80-second TTL, temporarily disabling the n8n trigger for this item.

Installation Guide

To use this n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and paste it into your n8n instance using the 'Import Workflow' function.

  2. Credentials Setup: You must configure credentials for the following services:

Notion API: Required for Get Notion page and Update task in Notion nodes. Ensure the integration has access to the relevant database.
Redis: Required for the Redis (Get) and Store (Set) nodes, essential for the locking mechanism.
* NextCloud/WebDAV: Required for the HTTP Request nodes to perform file operations (COPY, PROPFIND).

  1. Webhook Configuration: Activate the Webhook n8n trigger and link its URL to your Notion database to fire on page creation/update events.

  2. Path Customization: Review the Mapping code node and the HTTP Request nodes to ensure the hardcoded NextCloud paths (https://nextcloud.yuvrajsingh.icu/...) match your actual NextCloud environment and file structure. Adjust the empty.one template location as necessary.

Node Details

Webhook (n8n trigger): Serves as the starting point, listening for POST requests (likely from Notion).
Redis (Get & Store n8n node): Acts as a critical flow control mechanism, implementing a short-lived lock (lock{{ $json.body.entity.id }}) to prevent automation loops after Notion is updated by the n8n workflow itself.
Filter (n8n node): Checks if the Redis lock is active (if key value is 'Update'). If locked, it halts execution.
Get Notion page (n8n node): Retrieves the necessary metadata (Name, Subject, ID) from the page that initiated the n8n trigger.
Switch (n8n node): Gates the file creation logic, only proceeding if the Notion property intended for the OneNote URL (propertynotes) is empty.
Mapping (Code n8n node): Generates the dynamic file destination path for WebDAV (destination) and the final URL link (url) based on data retrieved from Notion.
HTTP Request (PROPFIND & COPY n8n nodes): Uses the WebDAV protocol to interact with NextCloud. HTTP Request1 checks directory contents (PROPFIND), and HTTP Request copies the template file (COPY) to create the new OneNote document.
Match titiles (Code n8n node): Performs complex parsing of the PROPFIND XML response and robust string comparison to verify if the file already exists before the n8n workflow attempts creation.


  • If (n8n node): Determines whether to proceed with the file copying sequence or to bypass it, based on the file existence check.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by
Yuvraj Singh
Yuvraj Singh

Featured*