How to create a daily backup workflow in n8n for a nested OneDrive folder to Google Drive with retention

I’m trying to create a workflow in n8n to automatically backup a folder from OneDrive to Google Drive every day, including all subfolders and files. I also want to keep only the last 30 daily backups in Google Drive.

OneDrive folder structure:
Folder1
├─ Folder2
└─ Folder3

markdown
Copy code
I want to backup Folder1 completely, including Folder2 and Folder3, into a daily folder in Google Drive like /Backups/Daily/YYYY-MM-DD/.
I don’t have a domain, only my server IP.
I’m self-hosting n8n on Docker.

What I’ve done so far

  • Created Schedule Trigger node for daily execution.
  • Added Microsoft OneDrive → Get items in a folder node for Folder1.
  • Unsure how to download all files recursively from subfolders.
  • Plan to use Google Drive → Upload a file node to create daily backup folders.
  • Need to implement automatic retention (delete backups older than 30 days).

My questions

  1. How can I recursively process all subfolders in OneDrive using n8n nodes?
  2. What is the recommended way to maintain folder structure when uploading to Google Drive?
  3. How should I implement automatic deletion of old daily backups in Google Drive?

I’d appreciate step-by-step guidance or example workflow JSON if possible.

No error yet — just unsure how to handle recursive folders and retention.

I haven’t created a complete workflow yet; I only have:

  • Schedule Trigger (daily)
  • Microsoft OneDrive → Get items in a folder (Folder1)

I’m trying to create a workflow in n8n to automatically backup a folder from OneDrive to Google Drive every day, including all subfolders and files. I also want to keep only the last 30 daily backups in Google Drive.

Here’s my scenario:
OneDrive folder structure:

Folder1
 ├─ Folder2
 └─ Folder3

I want to backup Folder1 completely, including Folder2 and Folder3, into a daily folder in Google Drive like /Backups/Daily/YYYY-MM-DD/.
I don’t have a domain, only my server IP.
I’m self-hosting n8n on Docker.

What I’ve done so far:

  • Created Schedule Trigger node for daily execution.

  • Added Microsoft OneDrive → Get items in a folder node for Folder1.

  • Unsure how to download all files recursively from subfolders.

  • Plan to use Google Drive → Upload a file node to create daily backup folders.

  • Need to implement automatic retention (delete backups older than 30 days).

My questions:

  1. How can I recursively process all subfolders in OneDrive using n8n nodes?

  2. What is the recommended way to maintain folder structure when uploading to Google Drive?

  3. How should I implement automatic deletion of old daily backups in Google Drive?

I’d appreciate step-by-step guidance or an example workflow JSON if possible.

Information on your n8n setup

  • n8n version: latest (1.115.x)
  • Database: SQLite (default)
  • n8n EXECUTIONS_PROCESS setting: default (own)
  • Running n8n via: Docker
  • Operating system: Ubuntu 22.04 LTS

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.