Skip to main content

N8N backup flow to Nextcloud (7-day retention)

Workflow preview

Workflow preview
100%
N8N backup flow to Nextcloud (7-day retention) preview
Open on n8n.io

Important notice

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

1. Workflow Overview

This workflow automates the daily backup of all your n8n workflows to a designated folder in Nextcloud. It ensures that you always have the last 7 days of backups available while automatically dele...

Best for

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

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.n8n, n8n-nodes-base.splitinbatches, n8n-nodes-base.sort, n8n-nodes-base.scheduletrigger, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.nextcloud

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
N8N backup flow to Nextcloud (7-day retention)
Workflow name
N8N backup flow to Nextcloud (7-day retention)

This workflow automates the daily backup of all your n8n workflows to a designated folder in Nextcloud. It ensures that you always have the last 7 days of backups available while automatically deleting older ones to save space.

đź”§ Features

Scheduled Trigger: Runs automatically once per day (can be executed manually as well).

Directory Management: Creates the /N8N-Backup directory in Nextcloud if it doesn't already exist.

Backup Collection: Retrieves all workflows from the n8n instance.

JSON Conversion: Converts each workflow into a JSON file.

Upload to Nextcloud: Saves each backup file into the specified backup directory.

Retention Control: Keeps only the latest 7 backups and deletes the rest from Nextcloud.

📌 Notes

Make sure to manually create the /N8N-Backup directory in your Nextcloud account before using this flow.

Update the Backup Path node if you wish to change the upload directory.

Ideal for teams using n8n with self-hosted instances and requiring offsite backup via Nextcloud.

đź”’ Requirements

n8n instance with access to the Nextcloud node.

Valid credentials for your Nextcloud account with API access.

Update: 08/11/2025 “Backup Flows to Nextcloud” – Import format fixed

Summary: The workflow now exports one clean JSON object per workflow (no arrays, no backup/meta fields), so files can be imported 1:1 via the n8n UI.

What changed:

Switched from “Convert to File” to a Set node that builds the JSON in binary data.

Enabled filters.include = "all" on Get many workflows to include nodes, connections, settings, pinData, and tags.

Sanitized filenames and removed IDs/metadata that can break UI imports.

Fixed Nextcloud path and binary property mapping (data).

Verification:

Generated multiple backups and imported each via UI (“Import from file”) without errors.

Each file begins with { (single object) and loads with full workflow structure.

Notes:

Keep “Binary Property” set to data in the Nextcloud node.

Filenames are sanitized to avoid special-character issues.

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 - On clicking 'execute'

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

Block 2 - n8n

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

Block 3 - Loop Over Items

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

Block 4 - Backups

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

Block 5 - Schedule Trigger

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

Block 6 - Sticky Note

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

Block 7 - Backup Path

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Nextcloud Directory

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

Block 9 - Nextcloud Upload

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

Block 10 - Nextcloud List Dir

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

Block 11 - Limits Backups

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

Block 12 - Nextcloud - Delete old backups

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

Block 13 - Code

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

3. Summary Table

Workflow N8N backup flow to Nextcloud (7-day retention)
Complexity intermediate
Nodes 13
Categories DevOps
Author Joachim Hummel
Published 23 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4338/4338.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 N8N backup flow to Nextcloud (7-day retention) do?

This workflow automates the daily backup of all your n8n workflows to a designated folder in Nextcloud. It ensures that you always have the last 7 days of backups available while automatically dele...

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.