{
  "name": "Complete backup solution for n8n workflows & credentials (local/FTP)",
  "nodes": [
    {
      "id": "",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -1408
      ],
      "parameters": {
        "width": 1264,
        "height": 528,
        "content": "## Backup Worflows & Credentials to Drive\nConfigure \"Init\" node in 2 sections.\n### Workflow Standard Configuration\n```\n// Admin email for notifications\nconst N8N_ADMIN_EMAIL = $env.N8N_ADMIN_EMAIL || "
      }
    },
    {
      "id": "",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        -816
      ],
      "parameters": {
        "width": 624,
        "height": 832,
        "content": "## Initialisation"
      }
    },
    {
      "id": "",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -816
      ],
      "parameters": {
        "width": 1232,
        "height": 272,
        "content": "## Credentials’ backup & FTP upload"
      }
    },
    {
      "id": "",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        576,
        -480
      ],
      "parameters": {
        "width": 1232,
        "height": 496,
        "content": "## Workflows’ backup & FTP upload"
      }
    },
    {
      "id": "",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1872,
        -816
      ],
      "parameters": {
        "width": 816,
        "height": 832,
        "content": "## Finalisation"
      }
    },
    {
      "id": "",
      "name": "Backup Summary",
      "type": "n8n-nodes-base.code",
      "position": [
        2112,
        -544
      ]
    },
    {
      "id": "",
      "name": "Write Backup Log",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        2320,
        -560
      ]
    },
    {
      "id": "",
      "name": "Send email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2528,
        -560
      ]
    },
    {
      "id": "",
      "name": "Write Email Log",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        2320,
        -752
      ]
    },
    {
      "id": "",
      "name": "Create Date Folder",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        368,
        -560
      ]
    },
    {
      "id": "",
      "name": "Init",
      "type": "n8n-nodes-base.code",
      "position": [
        160,
        -560
      ]
    },
    {
      "id": "",
      "name": "Daily Backup",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -48,
        -560
      ]
    },
    {
      "id": "",
      "name": "Convert to File",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1040,
        -336
      ]
    },
    {
      "id": "",
      "name": "Fetch Workflows",
      "type": "n8n-nodes-base.n8n",
      "position": [
        624,
        -336
      ]
    },
    {
      "id": "",
      "name": "Clean Filename",
      "type": "n8n-nodes-base.code",
      "position": [
        832,
        -336
      ]
    },
    {
      "id": "",
      "name": "Write Each Workflow To Disk",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1264,
        -240
      ]
    },
    {
      "id": "",
      "name": "ERROR: Backup Summary",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        2336,
        -368
      ]
    },
    {
      "id": "",
      "name": "ERROR: Clean Filename",
      "type": "n8n-nodes-base.stopAndError",
      "position": [
        1040,
        -144
      ]
    },
    {
      "id": "",
      "name": "Read/Write Files from Disk",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        1248,
        -736
      ]
    },
    {
      "id": "",
      "name": "List Credential Files",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        832,
        -736
      ]
    },
    {
      "id": "",
      "name": "Output Credential Items",
      "type": "n8n-nodes-base.code",
      "position": [
        1040,
        -736
      ]
    },
    {
      "id": "",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1472,
        -240
      ]
    },
    {
      "id": "",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        1920,
        -560
      ]
    },
    {
      "id": "",
      "name": "Upload Credentials To FTP",
      "type": "n8n-nodes-base.ftp",
      "position": [
        1456,
        -736
      ]
    },
    {
      "id": "",
      "name": "FTP Logger (credentials)",
      "type": "n8n-nodes-base.code",
      "position": [
        1664,
        -736
      ]
    },
    {
      "id": "",
      "name": "FTP Logger (workflows)",
      "type": "n8n-nodes-base.code",
      "position": [
        1472,
        -432
      ]
    },
    {
      "id": "",
      "name": "Export Credentials",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        624,
        -736
      ]
    },
    {
      "id": "",
      "name": "Upload Workflows To FTP",
      "type": "n8n-nodes-base.ftp",
      "position": [
        1264,
        -432
      ]
    }
  ],
  "connections": {
    "Init": {
      "main": [
        [
          {
            "node": "Create Date Folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Backup Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Daily Backup": {
      "main": [
        [
          {
            "node": "Init",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup Summary": {
      "main": [
        [
          {
            "node": "Write Backup Log",
            "type": "main",
            "index": 0
          },
          {
            "node": "Write Email Log",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ERROR: Backup Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clean Filename": {
      "main": [
        [
          {
            "node": "Convert to File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "ERROR: Clean Filename",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to File": {
      "main": [
        [
          {
            "node": "Upload Workflows To FTP",
            "type": "main",
            "index": 0
          },
          {
            "node": "Write Each Workflow To Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Workflows": {
      "main": [
        [
          {
            "node": "Clean Filename",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Backup Log": {
      "main": [
        [
          {
            "node": "Send email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Date Folder": {
      "main": [
        [
          {
            "node": "Fetch Workflows",
            "type": "main",
            "index": 0
          },
          {
            "node": "Export Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Export Credentials": {
      "main": [
        [
          {
            "node": "List Credential Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List Credential Files": {
      "main": [
        [
          {
            "node": "Output Credential Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FTP Logger (workflows)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Output Credential Items": {
      "main": [
        [
          {
            "node": "Read/Write Files from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Workflows To FTP": {
      "main": [
        [
          {
            "node": "FTP Logger (workflows)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "FTP Logger (credentials)": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload Credentials To FTP": {
      "main": [
        [
          {
            "node": "FTP Logger (credentials)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read/Write Files from Disk": {
      "main": [
        [
          {
            "node": "Upload Credentials To FTP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Write Each Workflow To Disk": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}