Nextcloud backups that keep every version safely
Your Nextcloud “backup” is probably a folder you drag somewhere when you remember. Then a file gets overwritten, a client asks for the older version, and you realize you don’t actually know what you have.
IT leads feel the pressure when restores turn into guesswork. agency owners managing client docs get burned by accidental edits. Even a solo founder running everything in Nextcloud can’t afford to lose version history. This Nextcloud backup automation keeps backups consistent and preserves the versions you’ll actually need.
Below is how the workflow runs, what it changes day-to-day, and what you need to get it live without turning this into a “project.”
How This Automation Works
See how this solves the problem:
n8n Workflow Template: Nextcloud backups that keep every version safely
flowchart LR
subgraph sg0["Manual Launch Flow"]
direction LR
n0@{ icon: "mdi:play-circle", form: "rounded", label: "Manual Launch Trigger", pos: "b", h: 48 }
n1@{ icon: "mdi:cog", form: "rounded", label: "Scheduled Automation Trigger", pos: "b", h: 48 }
n2["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Combine Data Streams"]
n3@{ icon: "mdi:cog", form: "rounded", label: "Convert to Binary Payload", pos: "b", h: 48 }
n4@{ icon: "mdi:code-braces", form: "rounded", label: "Transform Workflow Items", pos: "b", h: 48 }
n5["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Fetch Workflow Detail"]
n6["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/httprequest.dark.svg' width='40' height='40' /></div><br/>Retrieve Workflow Catalog"]
n7@{ icon: "mdi:code-braces", form: "rounded", label: "Item Cleanup Logic", pos: "b", h: 48 }
n8["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/nextcloud.svg' width='40' height='40' /></div><br/>Upload to Nextcloud Storage"]
n4 --> n5
n4 --> n2
n1 --> n6
n2 --> n7
n7 --> n3
n5 --> n2
n3 --> n8
n6 --> n4
n0 --> n6
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n0 trigger
class n5,n6 api
class n4,n7 code
classDef customIcon fill:none,stroke:none
class n2,n5,n6,n8 customIcon
The Challenge: Backups Without Trustworthy Version History
Nextcloud is great right up until you need to go backwards in time. Manual exports and “copy the folder to somewhere safe” routines look fine on paper, but they fall apart in real life. Someone renames files. Another person overwrites a document, then saves again. You end up with backups, sure, but not the right backups. The worst part is the mental load: every restore turns into detective work, and that slows down everything else you should be doing.
It adds up fast. Here’s where it usually breaks down.
- Backups happen inconsistently because the process depends on someone remembering to run it.
- Version history gets lost in exports, which means “restore” becomes “hope this is the right file.”
- You don’t get a clean, repeatable naming and packaging approach, so older backups become hard to search and verify.
- One missed week can create a huge gap, and you only notice after something goes wrong.
The Fix: Automated Nextcloud Backups With Versioned Detail
This n8n workflow runs on a schedule (or manually when you want) and pulls backup data through a Nextcloud REST API approach designed to preserve file versioning. It first collects a catalog of what needs to be backed up, then loops through items and fetches the detailed data for each one. Along the way it cleans up the items so you don’t end up uploading messy payloads or broken records. Finally, it converts the result into a binary file payload and uploads it into your Nextcloud storage so you have a centralized, consistent backup output you can restore from without second-guessing. Honestly, the biggest win is predictability.
The workflow starts with either a Cron schedule or a manual trigger. It pulls the workflow catalog, transforms items into the right structure, fetches the detail for each item, then merges everything into a clean package. From there it creates a binary file and uploads it to Nextcloud for safekeeping.
What Changes: Before vs. After
| What This Eliminates | Impact You’ll See |
|---|---|
|
|
Real-World Impact
Say you manage about 200 important files and folders in Nextcloud and you do a “proper” manual backup once a week. Even if you’re quick, you’ll spend about 10 minutes collecting the right areas, another 20 minutes exporting and naming things, then more time verifying what you got. Call it an hour. With this automation, you set the schedule once, let it run, and only spend a few minutes a week checking the latest uploaded backup. That’s roughly 45 minutes back, every week, and restores stop being a coin flip.
Requirements
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Nextcloud to store the backup output file.
- Nextcloud credentials for authentication and folder access.
- Nextcloud app password (create it in Nextcloud Security settings).
Skill level: Intermediate. You’ll be comfortable adding credentials, testing HTTP requests, and adjusting a few values safely.
Need help implementing this? Talk to an automation expert (free 15-minute consultation).
The Workflow Flow
A schedule (or a manual run) kicks it off. The Cron trigger runs the backup automatically, and the manual trigger is there for testing or one-off runs when you’ve just made big changes.
The workflow pulls a catalog of what to back up. Using an HTTP request, it retrieves the workflow catalog, then a transformation step reshapes items into a clean list that’s easy to process and less likely to break downstream.
Details are fetched and cleaned before packaging. For each item, another HTTP request fetches the detail, a merge combines streams, and item cleanup logic removes noise so the final backup is consistent. This is where a lot of “mystery restore problems” get prevented.
A file is created and uploaded into Nextcloud. The workflow converts the final data into a binary payload and uploads it to your Nextcloud storage, giving you a repeatable backup artifact you can store, copy, or move later.
You can easily modify where backups land (folder path) and how they’re named based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual and Scheduled Triggers
Set up the trigger nodes so you can run backups manually or on a schedule.
- Add the Manual Launch Trigger node to enable on-demand runs.
- Add the Scheduled Automation Trigger node and set Trigger Times to
* */6 * * *for every 6 hours. - Connect both Manual Launch Trigger and Scheduled Automation Trigger to Retrieve Workflow Catalog.
Step 2: Connect the n8n REST API to Pull Workflows
Retrieve the list of workflows and prepare items for detail fetches.
- In Retrieve Workflow Catalog, set URL to
http://localhost:5678/rest/workflows. - In Transform Workflow Items, set Function Code to
return items[0].json.data.map(item => { return {json: item} });. - Connect Retrieve Workflow Catalog to Transform Workflow Items.
Step 3: Configure Parallel Data Fetching and Merge
Fetch each workflow’s full JSON and merge it with the item list.
- In Fetch Workflow Detail, set URL to
=http://localhost:5678/rest/workflows/{{$node["Transform Workflow Items"].data["id"]}}. - Set Combine Data Streams to Mode
mergeByIndex. - Connect Transform Workflow Items so it outputs to both Fetch Workflow Detail and Combine Data Streams in parallel.
- Connect Fetch Workflow Detail to the second input of Combine Data Streams.
Step 4: Prepare the Backup File and Upload to Nextcloud
Clean the merged data, convert it to binary JSON, and upload to Nextcloud.
- In Item Cleanup Logic, set Function Code to
item = item.data; return item;. - In Convert to Binary Payload, set Mode to
jsonToBinary. - In Upload to Nextcloud Storage, enable Binary Data Upload and set Path to
=/n8n/Backup/lacnet1/{{$node["Combine Data Streams"].data["name"]}}.json.
Step 5: Test and Activate Your Workflow
Run a manual test, validate the backup file, and then activate the workflow for production use.
- Click Execute Workflow using Manual Launch Trigger.
- Confirm that Upload to Nextcloud Storage completes successfully and a
.jsonfile appears in the target folder. - If the file is missing or empty, re-check the parallel merge path between Fetch Workflow Detail and Combine Data Streams.
- Toggle the workflow to Active to enable the Scheduled Automation Trigger schedule.
Watch Out For
- Nextcloud credentials can expire or need specific permissions. If things break, check your Nextcloud app password and the target folder permissions first.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Common Questions
About 30 minutes if your Nextcloud credentials are ready.
Yes, but you’ll want someone comfortable testing connections. No coding, though, and the workflow is mostly plug-and-run once credentials are in.
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in Nextcloud storage and any server costs if you host it yourself.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
You can change the schedule in the Cron trigger and adjust what gets backed up by editing the catalog-fetch HTTP request and the “Transform Workflow Items” logic. Common tweaks include switching the destination folder in the Nextcloud upload node, adding a timestamp-based filename, and filtering out low-value items during the “Item Cleanup Logic” step.
Usually it’s an expired app password or a permission issue on the destination folder. Regenerate the Nextcloud app password, update it in n8n credentials, and confirm the upload path exists. If you’re using a reverse proxy or custom domain, also double-check the base URL in your HTTP request nodes because a small URL mismatch can look like an auth problem.
It depends more on your n8n plan and server than Nextcloud itself. On n8n Cloud Starter you can run a healthy number of scheduled executions each month, and self-hosting removes the execution cap. Practically, you’ll be limited by how many items you pull per run and how fast your Nextcloud instance responds, so start with a smaller catalog and scale up once it’s stable.
Often, yes. This kind of backup flow tends to need branching, merging, cleanup logic, and careful handling of payloads, and n8n is simply more comfortable there. It also gives you a self-host route, which matters when you want unlimited scheduled runs and tighter control over credentials. Zapier or Make can still work for very simple “copy file to storage” jobs, but version-aware backups are rarely that simple. If you want a second opinion, Talk to an automation expert and we’ll sanity-check your use case.
Once this is running, backups stop being a background anxiety. Your Nextcloud history stays usable, and restores become a quick decision instead of a long afternoon.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.