Skip to main content

Auto-backup n8n workflows to OneDrive with cleanup & email notifications

Workflow preview

Workflow preview
100%
Auto-backup n8n workflows to OneDrive with cleanup & email notifications preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Automatically BackUp Your n8n Workflows to OneDrive This workflow automates the backup of your self hosted n8n instance by exporting all workflows and saving them as individual files to a designate...

Best for

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

Tools used

n8n-nodes-base.n8n, n8n-nodes-base.microsoftonedrive, n8n-nodes-base.code, n8n-nodes-base.scheduletrigger, n8n-nodes-base.microsoftoutlook, n8n-nodes-base.switch, n8n-nodes-base.splitinbatches, n8n-nodes-base.merge

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Auto-backup n8n workflows to OneDrive with cleanup & email notifications
Workflow name
Auto-backup n8n workflows to OneDrive with cleanup & email notifications

Automatically BackUp Your n8n Workflows to OneDrive

This workflow automates the backup of your self-hosted n8n instance by exporting all workflows and saving them as individual .json files to a designated OneDrive folder. Each file is timestamped for easy versioning and audit tracking.

After a successful backup, the workflow optionally cleans up old backup files and sends a confirmation email to notify you that the process completed.

How it works

  1. Uses the HTTP Request node to fetch all workflows via the /rest/workflows API.
  2. Iterates through each workflow using SplitInBatches.
  3. Converts each workflow to a .json file using Set and Function nodes.
  4. Uploads each file to a target Microsoft OneDrive folder using OAuth2.
  5. Deletes old backup files from OneDrive after upload, with the option to keep backups for a configurable number of time.
  6. Sends an email notification once all backups have completed successfully.

Setup instructions

  • Enter your n8n Base URL and authentication details in the HTTP Request node.
  • Set up Microsoft OneDrive OAuth2 credentials for cloud upload.
  • Configure the Email node with SMTP credentials to receive backup confirmation.
  • (Optional) Adjust the file retention logic to keep backups for a set duration.
  • A Cron trigger to schedule the workflow automatically (e.g., daily or weekly).

👉 Sticky notes inside the workflow explain each step for easy setup.

Need Help

  • Need Help

🔗 LinkedIn – Wessel Bulte

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 - Retrieve workflows

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

Block 2 - Get backupfolders

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

Block 3 - Delete old backup folder

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

Block 4 - Prepare HTML Email

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

Block 5 - Schedule Trigger Daily

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.2

Block 6 - Send HTML Success Email

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

Block 7 - Search a folder

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

Block 8 - Switch Old Folders

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 9 - Loop Over Items

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

Block 10 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 11 - Create new backup folder

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

Block 12 - Convert to JSON file

Type / Role
n8n-nodes-base.convertToFile - convertToFile
Config choices
Version 1.1

Block 13 - Upload JSON to folder

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

Block 14 - Filter backup folder

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

Block 15 - Sticky Note - Overview

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

Block 16 - Sticky Note - Send HTML Success Email

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

Block 17 - Sticky Note - Prepare HTML Email

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

Block 18 - Sticky Note - Merge

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

Block 19 - Sticky Note - Delete old backup folder

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

Block 20 - Sticky Note - Loop Over Items

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

Block 21 - Sticky Note - Switch Old Folders

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

Block 22 - Sticky Note - Filter backup folder

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

Block 23 - Sticky Note - Get backupfolders

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

Block 24 - Sticky Note - Upload JSON to folder

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 Auto-backup n8n workflows to OneDrive with cleanup & email notifications
Complexity advanced
Nodes 29
Categories DevOps
Author Wessel Bulte
Published 10 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8451/8451.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 Auto-backup n8n workflows to OneDrive with cleanup & email notifications do?

Automatically BackUp Your n8n Workflows to OneDrive This workflow automates the backup of your self hosted n8n instance by exporting all workflows and saving them as individual files to a designate...

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 DevOps use case.