{
  "nodes": [
    {
      "id": "940a4fec-64a8-4b6f-aff1-e00c01575f26",
      "name": "Get many workflows1",
      "type": "n8n-nodes-base.n8n",
      "position": [
        -16,
        240
      ],
      "parameters": {
        "filters": {},
        "requestOptions": {}
      },
      "typeVersion": 1
    },
    {
      "id": "d0ca364d-4d7b-4365-9b38-a90eb9fce007",
      "name": "Upload file1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        656,
        240
      ],
      "parameters": {
        "name": "={{ $('Get a workflow1').item.json.name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "options": {},
        "folderId": {
          "__rl": true,
          "mode": "list",
          "value": "YOUR_FOLDER_ID",
          "cachedResultUrl": "https://drive.google.com/drive/folders/YOUR_FOLDER_ID",
          "cachedResultName": "YOUR_FOLDER"
        },
        "inputDataFieldName": "=data"
      },
      "typeVersion": 3
    },
    {
      "id": "e71ddeae-a878-4c43-9aff-2711c9923181",
      "name": "Get a workflow1",
      "type": "n8n-nodes-base.n8n",
      "position": [
        208,
        240
      ],
      "parameters": {
        "operation": "get",
        "workflowId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "requestOptions": {}
      },
      "typeVersion": 1
    },
    {
      "id": "ae0310b0-2989-4906-bec2-c69d7aa1b94f",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -240,
        240
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "499fb4ce-7cb5-4a9a-8367-8d3f5ee5ba59",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -112,
        16
      ],
      "parameters": {
        "height": 288,
        "content": "## Get many workflows\n\n\ud83d\udce5 Fetch all workflows\nQueries the n8n API and retrieves the complete list of existing workflows in the account. This is the first step to collect the data that will be backed up.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "b8a2c929-99ae-4e6e-a0a9-95180bef240f",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        128,
        16
      ],
      "parameters": {
        "height": 288,
        "content": "## Get a workflow\n\n\ud83d\udcc2 Fetch a specific workflow\nWith the ID provided in the previous step, download the full data of each workflow one by one. This ensures you have the exact definition of each flow.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a8d53d87-432e-4ac7-9101-a91faa5595fe",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        16
      ],
      "parameters": {
        "height": 288,
        "content": "## Upload file (Google Drive)\n\n\u2601\ufe0f Upload to Google Drive\nSaves the JSON or docs files into the configured Google Drive folder. This way you have all backups centralized and available at any time.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7e444802-2113-4c68-a38b-f4d5e338c2e0",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        0
      ],
      "parameters": {
        "height": 288,
        "content": "## Schedule Trigger\n\n\u23f0 Scheduled trigger\nAllows the flow to run automatically according to a defined interval. In this case, it is set to run weekly, ensuring backups are made without manual intervention.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f9f3a623-5909-4cd3-af45-04e51fc33554",
      "name": "Move Binary Data (JSON \u2192 File)",
      "type": "n8n-nodes-base.moveBinaryData",
      "position": [
        432,
        240
      ],
      "parameters": {
        "mode": "jsonToBinary",
        "options": {
          "fileName": "={{ $json.name.replace(/[^a-zA-Z0-9_\\-]/g, '') + '_' + $json.id + '.json' }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "121182c2-5f6e-429a-a9b5-b2835c2dd47c",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        352,
        16
      ],
      "parameters": {
        "height": 288,
        "content": "## Move Binary Data (JSON \u2192 File)\n\n\ud83d\udce6 Convert to file\nTransforms each downloaded workflow into a JSON file. Additionally, it generates a filename that combines the workflow name and ID, avoiding problematic characters.\n"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Get a workflow1": {
      "main": [
        [
          {
            "node": "Move Binary Data (JSON \u2192 File)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Get many workflows1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get many workflows1": {
      "main": [
        [
          {
            "node": "Get a workflow1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move Binary Data (JSON \u2192 File)": {
      "main": [
        [
          {
            "node": "Upload file1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}