Use this robust n8n workflow to automatically identify and archive redundant or duplicate pages in your Notion database based on specific property values. A powerful n8n template.
Download this n8n workflow template and start using it instantly.
Notion power users needing automated database cleanup and data integrity maintenance.
Users looking for advanced examples of the n8n Code node for sophisticated data manipulation.
Automation specialists seeking reliable n8n templates for recurring maintenance tasks.
Anyone aiming to optimize their Notion workspace efficiency using a robust n8n workflow.
This sophisticated n8n workflow solves the common problem of data redundancy in Notion databases. Instead of manually reviewing thousands of entries, this automation runs on a set schedule or upon item creation, fetching all existing pages. It leverages a custom n8n node (the Code node) to perform efficient deduplication based on a user-defined property (like Title or URL). Once duplicates are identified (leaving one original copy untouched), the n8n workflow proceeds to archive them instantly. This prevents clutter, maintains data integrity, and is a fantastic example of what you can achieve with custom scripting inside an n8n node. This specific n8n template provides two convenient n8n trigger options: daily runs or triggering when a new page is added.
propertytocheck field.pages, preparing it for processing in the next step.propertytocheck value has already been encountered, and outputs only the second (and subsequent) duplicate items.propertytocheck, you must replace the placeholder "SET YOUR PROPERTY HERE" with the actual reference to the property you want to use for deduplication (e.g., the Page Title, a unique URL, or a text property). Use the n8n expression editor for accurate mapping. Schedule Trigger / Notion Trigger: These n8n trigger nodes start the automation. You can choose to run this n8n workflow daily or whenever a new page is added to the Notion database.
Notion Node (Get pages from database): Fetches all items from the configured Notion database. Key configuration: operation: getAll, returnAll: true.
Set Node (Format items properly): A crucial preparation n8n node where the user configures the exact Notion property used for checking duplicates, mapping it to the propertytocheck field.
Aggregate Node (Aggregate all items): Combines all fetched items into one data array (pages), which is essential for list processing in the subsequent Code n8n node.
Code Node (Filter duplicates): The core logic of this n8n workflow. This custom n8n node uses efficient JavaScript logic to identify and output only the duplicate items based on the mapped property value, ensuring the first instance is always preserved.
Notion Node (Archive pages): The final action n8n node, responsible for archiving (effectively deleting) all incoming duplicate page IDs by setting the archived status to true in Notion.
Instantly diagnose failed n8n workflows using AI. This n8n workflow template leverages OpenAI (GPT-4o) to analyze errors, providing immediate cause and resolution reports via Gmail.

Use this powerful n8n workflow to build an AI chatbot with persistent long-term memory (via Google Docs) and a dynamic tools router for saving, retrieving, and sharing context via Gmail or Telegram.

Build sophisticated AI agents in n8n using a Think-Act architecture. This n8n workflow leverages OpenRouter language models and robust n8n node configurations for complex, multi-step reasoning tasks.

I'm a backend software developer who loves n8n ⚙️ I enjoy automating everything and share templates I personally find helpful 💡







































