{
  "name": "N8N backup flow to Nextcloud (7-day retention)",
  "nodes": [
    {
      "id": "5a95d578-fa4a-400f-9f4c-e0263484831e",
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        416,
        432
      ]
    },
    {
      "id": "502e7322-74c1-4fce-933d-73628215adb6",
      "name": "n8n",
      "type": "n8n-nodes-base.n8n",
      "position": [
        1008,
        544
      ]
    },
    {
      "id": "2a7c2c11-30ab-4e4b-b1c8-bd5a4ecaac11",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1280,
        544
      ]
    },
    {
      "id": "8e3dd7ae-18dd-4389-920e-ff37a83685c3",
      "name": "Backups",
      "type": "n8n-nodes-base.sort",
      "position": [
        1200,
        352
      ]
    },
    {
      "id": "e1e8f61c-a6fb-4982-a141-6326bdc03df1",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        416,
        640
      ]
    },
    {
      "id": "5ec178d4-99ac-4dc0-91ff-bdd4e5a18212",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        240
      ],
      "parameters": {
        "width": 1520,
        "height": 680,
        "content": "## N8N Backup Flow\n### - Create /N8N-Backup Directory manual in Nextcloud\n### - Edit Backup Path"
      }
    },
    {
      "id": "d8aa50c8-123b-44be-8777-53bdb50557d9",
      "name": "Backup Path",
      "type": "n8n-nodes-base.set",
      "position": [
        608,
        544
      ]
    },
    {
      "id": "f808618a-6677-4fc9-8227-f5e5acc96bdf",
      "name": "Nextcloud Directory",
      "type": "n8n-nodes-base.nextCloud",
      "position": [
        816,
        544
      ]
    },
    {
      "id": "1f179a8c-0af6-4510-b9aa-f928b91525f4",
      "name": "Nextcloud Upload",
      "type": "n8n-nodes-base.nextCloud",
      "position": [
        1728,
        560
      ]
    },
    {
      "id": "efaa98ff-efe8-4d2c-8496-21f259620f87",
      "name": "Nextcloud List Dir",
      "type": "n8n-nodes-base.nextCloud",
      "position": [
        1008,
        352
      ]
    },
    {
      "id": "aeb2430a-c6af-4583-97ea-1fcbdc596e6a",
      "name": "Limits Backups",
      "type": "n8n-nodes-base.code",
      "position": [
        1392,
        352
      ]
    },
    {
      "id": "650e7660-3c1c-48f0-983e-76d9b76f8857",
      "name": "Nextcloud - Delete old backups",
      "type": "n8n-nodes-base.nextCloud",
      "position": [
        1600,
        352
      ]
    },
    {
      "id": "8037f92d-8572-4753-b1a8-531afe980858",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        1504,
        560
      ]
    }
  ],
  "connections": {
    "n8n": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Nextcloud Upload",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backups": {
      "main": [
        [
          {
            "node": "Limits Backups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup Path": {
      "main": [
        [
          {
            "node": "Nextcloud Directory",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limits Backups": {
      "main": [
        [
          {
            "node": "Nextcloud - Delete old backups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Nextcloud List Dir",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nextcloud Upload": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Backup Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nextcloud List Dir": {
      "main": [
        [
          {
            "node": "Backups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nextcloud Directory": {
      "main": [
        [
          {
            "node": "n8n",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "Backup Path",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Nextcloud - Delete old backups": {
      "main": [
        []
      ]
    }
  }
}