{
  "name": "Automate workflow & credentials backup to S3 with retention management",
  "nodes": [
    {
      "id": "387e5dfd-f988-49df-a14e-4bc05d228861",
      "name": "Get many workflows",
      "type": "n8n-nodes-base.n8n",
      "position": [
        416,
        -96
      ]
    },
    {
      "id": "e9fcf8bb-c91f-4aec-8449-9dbcc83f09ff",
      "name": "Config",
      "type": "n8n-nodes-base.set",
      "position": [
        144,
        96
      ]
    },
    {
      "id": "a376ab24-6411-462f-9132-2e22f823c3b2",
      "name": "Extract Date",
      "type": "n8n-nodes-base.set",
      "position": [
        912,
        240
      ]
    },
    {
      "id": "e8f2e585-bf39-40ee-a91d-c17348708b28",
      "name": "Keep Outdated Backups",
      "type": "n8n-nodes-base.filter",
      "position": [
        1200,
        240
      ]
    },
    {
      "id": "f8eea97f-9d2d-4023-938e-c410978cb490",
      "name": "Delete Outdated Backups",
      "type": "n8n-nodes-base.s3",
      "position": [
        1424,
        240
      ]
    },
    {
      "id": "6457633f-b64f-4288-b7ee-102ef5592961",
      "name": "Export Credentials",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        368,
        592
      ]
    },
    {
      "id": "969eea4c-d592-435e-8bd3-e39ad5112378",
      "name": "Load Credentials",
      "type": "n8n-nodes-base.readWriteFile",
      "position": [
        592,
        592
      ]
    },
    {
      "id": "a340ac8c-ce0a-40f4-ab55-e90014878763",
      "name": "Delete Temporary File",
      "type": "n8n-nodes-base.executeCommand",
      "position": [
        1040,
        592
      ]
    },
    {
      "id": "6d7e2501-fe77-4ed9-8f10-50bcafebaa6b",
      "name": "Store Credentials Backup",
      "type": "n8n-nodes-base.s3",
      "position": [
        816,
        592
      ]
    },
    {
      "id": "68e5990e-9b17-4581-8498-3e656efbf611",
      "name": "Store Workflow Backup",
      "type": "n8n-nodes-base.s3",
      "position": [
        880,
        -96
      ]
    },
    {
      "id": "d9403837-7a26-4d9b-9460-6cc2c62a625c",
      "name": "Daily Backup",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -80,
        96
      ]
    },
    {
      "id": "d3feef71-cb5d-4986-b7e3-556c3ad4606c",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        -240
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "## TODO\n- Set the credentials for your backup S3 bucket here."
      }
    },
    {
      "id": "3d017215-bd7f-4a66-839c-6621f617aa2d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1344,
        112
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "## TODO\n- Set the credentials for your backup S3 bucket here."
      }
    },
    {
      "id": "94b6fc3c-7356-4038-ac3b-13ff55327a7f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        464
      ],
      "parameters": {
        "width": null,
        "height": 304,
        "content": "## TODO\n- Set the credentials for your backup S3 bucket here."
      }
    },
    {
      "id": "c8d84477-1d0b-4521-9273-6190ccc9b19b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        144
      ],
      "parameters": {
        "width": null,
        "height": 288,
        "content": "## TODO\n- Set the credentials for your backup S3 bucket here."
      }
    },
    {
      "id": "bb4f024b-715f-4dbc-8dcf-5a093863ea62",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        64,
        -176
      ],
      "parameters": {
        "width": null,
        "height": 432,
        "content": "## TODO\n- Adjust retention (how long backups are kept, default: 31 days)\n- Configure the name of the bucket that shall be used for storing the backups."
      }
    },
    {
      "id": "3742caa7-1b6d-4b48-ae8b-642a5576c4c7",
      "name": "Get Existing Backups",
      "type": "n8n-nodes-base.s3",
      "position": [
        528,
        240
      ]
    },
    {
      "id": "2369ab66-4837-4a28-87ef-9479eaf47a3f",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        -176
      ],
      "parameters": {
        "width": null,
        "height": 432,
        "content": "## TODO\n- Adjust the trigger to suit your schedule (default: daily execution at 11pm)\n- Remember to activate the workflow once all TODOs are resolved\n- Test the workflow by executing it."
      }
    },
    {
      "id": "a4523efd-8786-4cbc-a5f2-51d11bd8282e",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        336,
        -240
      ],
      "parameters": {
        "width": null,
        "height": 320,
        "content": "## TODO\n- Create an N8N API Key in the N8n settings\n- Configure it in the credentials of this node."
      }
    }
  ],
  "connections": {
    "Config": {
      "main": [
        [
          {
            "node": "Get many workflows",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Existing Backups",
            "type": "main",
            "index": 0
          },
          {
            "node": "Export Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Backup": {
      "main": [
        [
          {
            "node": "Config",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Date": {
      "main": [
        [
          {
            "node": "Keep Outdated Backups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Load Credentials": {
      "main": [
        [
          {
            "node": "Store Credentials Backup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Export Credentials": {
      "main": [
        [
          {
            "node": "Load Credentials",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many workflows": {
      "main": [
        [
          {
            "node": "Store Workflow Backup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Existing Backups": {
      "main": [
        [
          {
            "node": "Extract Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep Outdated Backups": {
      "main": [
        [
          {
            "node": "Delete Outdated Backups",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Store Credentials Backup": {
      "main": [
        [
          {
            "node": "Delete Temporary File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}