{
  "name": "Back up n8n workflows to google drive while preserving folder structure",
  "nodes": [
    {
      "id": "3fd2c2d7-e952-4089-a0f0-f10ebe2b49e1",
      "name": "n8n login API1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1184,
        1552
      ]
    },
    {
      "id": "a7aa39e5-7365-4ee2-92b8-731a5bcfe0fe",
      "name": "get subfolder(s) structure",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1568,
        1552
      ]
    },
    {
      "id": "4afec708-a63f-4337-90ca-9ec8eb324bbe",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1472,
        1408
      ],
      "parameters": {
        "width": 2048,
        "height": 352,
        "content": "# 3/ Get project folder(s) and add names in n8n tables \"folders\" & \"workflows\" : root and subfolders"
      }
    },
    {
      "id": "2d8bb722-0ad4-46d0-9b70-ccf9dec591e1",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        5904,
        688
      ]
    },
    {
      "id": "3986a459-2d39-4cad-96af-43b2013af546",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4144,
        192
      ],
      "parameters": {
        "width": 1056,
        "height": 304,
        "content": "# 4/ Assign the folder's fullPath value"
      }
    },
    {
      "id": "7396cc15-be5d-41a0-b390-3ff9e9bc47f1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4144,
        576
      ],
      "parameters": {
        "width": 2800,
        "height": 384,
        "content": "# 5/ Get workflow + folder relation with full path and add it to \"workflows\" table"
      }
    },
    {
      "id": "be656883-d32c-4820-999d-22b56bf694c9",
      "name": "Search if folder already exists",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        7472,
        1280
      ]
    },
    {
      "id": "980ede93-1d45-4c68-8538-f6e4fb2bb3f2",
      "name": "if folder not found => create it",
      "type": "n8n-nodes-base.if",
      "position": [
        7744,
        1280
      ]
    },
    {
      "id": "7ec9d727-0dd0-49c0-9ccf-65cf876562d6",
      "name": "Attach the parentFolder if any",
      "type": "n8n-nodes-base.set",
      "position": [
        8064,
        1264
      ]
    },
    {
      "id": "a76a1ab3-d5d7-4876-b77c-c961acac7b30",
      "name": "if parentFolder empty",
      "type": "n8n-nodes-base.if",
      "position": [
        8352,
        1264
      ]
    },
    {
      "id": "5dbd2002-c3b8-4c2e-85ca-6a170122ab42",
      "name": "Create folder under the parentFolder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        9120,
        1552
      ]
    },
    {
      "id": "033fd371-ce8e-4ebf-9a91-1b14a03a4560",
      "name": "Split Out3",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        4432,
        3456
      ]
    },
    {
      "id": "589f781f-df42-4a3b-8088-8cf439d1dcaa",
      "name": "Merge1",
      "type": "n8n-nodes-base.merge",
      "position": [
        6432,
        3488
      ]
    },
    {
      "id": "61ce5ba7-057b-4d52-b959-07ab96476e69",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4160,
        2944
      ],
      "parameters": {
        "width": 5344,
        "height": 976,
        "content": "# 8/ Upload each JSON workflow file into its google drive folder"
      }
    },
    {
      "id": "82ba512f-bb51-44a8-a6d8-53f952a5d555",
      "name": "Merge2",
      "type": "n8n-nodes-base.merge",
      "position": [
        7456,
        3392
      ]
    },
    {
      "id": "acb15afa-4bfa-4941-9b6d-6e187173c7ab",
      "name": "wf_id + wf_name",
      "type": "n8n-nodes-base.set",
      "position": [
        7216,
        3264
      ]
    },
    {
      "id": "8d6830e5-b23f-4d19-93f9-f619370487aa",
      "name": "root folder : backup_n8n",
      "type": "n8n-nodes-base.set",
      "position": [
        8288,
        3232
      ]
    },
    {
      "id": "79b54cb4-b62d-4af5-8113-d7182b791206",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9536,
        1280
      ],
      "parameters": {
        "width": 336,
        "height": 80,
        "content": "## root folder(s) : full_path = 1"
      }
    },
    {
      "id": "2e1f5257-1526-4541-adfb-8a10e818cb08",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9872,
        1616
      ],
      "parameters": {
        "width": 352,
        "height": 96,
        "content": "## subfolders : full_path>1"
      }
    },
    {
      "id": "5c60442e-8909-4780-93eb-218cfa1c91bb",
      "name": "Merge3",
      "type": "n8n-nodes-base.merge",
      "position": [
        5248,
        1520
      ]
    },
    {
      "id": "657b0921-4949-4a10-b9e7-e09bc51e311f",
      "name": "Merge6",
      "type": "n8n-nodes-base.merge",
      "position": [
        8912,
        1552
      ]
    },
    {
      "id": "b2172894-132e-4eb9-bfca-0c141183393a",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4160,
        2112
      ],
      "parameters": {
        "width": 3264,
        "height": 688,
        "content": "# 7/ Assign \"parent_google_folderid\" value in \"folders\" table"
      }
    },
    {
      "id": "184498fc-c2ef-47bd-b6bb-94a50dc77b41",
      "name": "Aggregate3",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        3680,
        1536
      ]
    },
    {
      "id": "0d88a854-2947-4b8e-ab6f-cf1965342c60",
      "name": "Split Out1",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2336,
        1552
      ]
    },
    {
      "id": "b7fc919b-ffff-414a-b784-17d2597a9970",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        6208,
        688
      ]
    },
    {
      "id": "5d78ff31-f946-4897-8b7c-76e84113f822",
      "name": "rename fields",
      "type": "n8n-nodes-base.set",
      "position": [
        6480,
        688
      ]
    },
    {
      "id": "5bf19a77-1511-4d2a-8980-6f33e43233fe",
      "name": "rename fields1",
      "type": "n8n-nodes-base.set",
      "position": [
        3008,
        1536
      ]
    },
    {
      "id": "05c4785a-36e8-4cca-894c-23047f7e2148",
      "name": "rename main_root_folder fields",
      "type": "n8n-nodes-base.set",
      "position": [
        4864,
        1344
      ]
    },
    {
      "id": "963e9983-47af-4675-90dc-44fd4c91a00e",
      "name": "Create folder under the static \"backup_n8n\" folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        8784,
        1248
      ]
    },
    {
      "id": "cea7e2c7-f710-4a6f-93c4-2c76618319fc",
      "name": "rename fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        9088,
        1248
      ]
    },
    {
      "id": "388a2756-fd38-43cc-9854-950c130bc514",
      "name": "rename fields3",
      "type": "n8n-nodes-base.set",
      "position": [
        9424,
        1552
      ]
    },
    {
      "id": "47dd15be-4b2c-4638-b30f-ff12541e7320",
      "name": "get directParentFolderName",
      "type": "n8n-nodes-base.set",
      "position": [
        4656,
        2400
      ]
    },
    {
      "id": "2a9e7181-8a9b-4b63-a537-698f330f26cc",
      "name": "Split root vs subfolders",
      "type": "n8n-nodes-base.if",
      "position": [
        4928,
        2400
      ]
    },
    {
      "id": "74042713-716f-4efd-b589-a1a181444ced",
      "name": "Merge4",
      "type": "n8n-nodes-base.merge",
      "position": [
        5776,
        2624
      ]
    },
    {
      "id": "8504b867-000c-4d6e-8644-e9fdb36e4659",
      "name": "Remove Duplicates1",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        5984,
        2624
      ]
    },
    {
      "id": "b95a83ef-8333-4919-9084-efd6cfeb1ffe",
      "name": "rename fields4",
      "type": "n8n-nodes-base.set",
      "position": [
        6192,
        2624
      ]
    },
    {
      "id": "4de20b20-1ff1-49ab-81b4-5e98fcd63b6c",
      "name": "rename fields5",
      "type": "n8n-nodes-base.set",
      "position": [
        5568,
        2416
      ]
    },
    {
      "id": "fbb5e25e-2141-4eb7-96a1-77fb348c596c",
      "name": "rename fields6",
      "type": "n8n-nodes-base.set",
      "position": [
        6176,
        2272
      ]
    },
    {
      "id": "67f678a6-34e5-4feb-ad1b-2090dfc2811d",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6672,
        2288
      ],
      "parameters": {
        "width": 624,
        "height": 80,
        "content": "## Assign \"parent_google_folderid\" value to root folders"
      }
    },
    {
      "id": "1b6e6294-2752-4d10-854e-1a2f1a4ee8ee",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6672,
        2624
      ],
      "parameters": {
        "width": 624,
        "height": 80,
        "content": "## Assign \"parent_google_folderid\" value to sub folders"
      }
    },
    {
      "id": "1927323f-1881-4564-92ef-dfb739149ecc",
      "name": "If there parentFolder.isEmpty()",
      "type": "n8n-nodes-base.if",
      "position": [
        5024,
        3456
      ]
    },
    {
      "id": "2f7bc2c9-ee12-45b3-ba9a-fb04b9db1092",
      "name": "Remove Duplicates2",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        6720,
        3488
      ]
    },
    {
      "id": "0e7b52dc-b634-49fa-8a47-5957c4e7e7e0",
      "name": "Merge5",
      "type": "n8n-nodes-base.merge",
      "position": [
        6480,
        3184
      ]
    },
    {
      "id": "25244f08-401a-4f65-95c5-a12ad27ae972",
      "name": "rename fields7",
      "type": "n8n-nodes-base.set",
      "position": [
        6704,
        3184
      ]
    },
    {
      "id": "fc8e350a-9b53-4d17-9024-8faf4b92c683",
      "name": "Upload file to its folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        8528,
        3600
      ]
    },
    {
      "id": "267d479f-1321-40e5-9cf4-e4969c3c8773",
      "name": "root folder : backup_n8n1",
      "type": "n8n-nodes-base.set",
      "position": [
        8288,
        3600
      ]
    },
    {
      "id": "956d858c-8ea8-4e0a-8b8e-57d7769f4e3f",
      "name": "If parentFolder is null",
      "type": "n8n-nodes-base.if",
      "position": [
        7936,
        3392
      ]
    },
    {
      "id": "1ad681d2-5f96-4c52-9a65-e3dcecc6f3ba",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        8976,
        3248
      ],
      "parameters": {
        "width": 496,
        "height": 80,
        "content": "## workflows at the main root folder location"
      }
    },
    {
      "id": "543cd2d7-ce2b-43b8-810e-f881043be5ed",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        9040,
        3600
      ],
      "parameters": {
        "width": 432,
        "height": 80,
        "content": "## workflows in other folders"
      }
    },
    {
      "id": "2a74fe1b-1e21-4096-9948-81513d52f8f8",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1712,
        1216
      ],
      "parameters": {
        "width": 1104,
        "height": 576,
        "content": "# 1/ Initialize n8n instance access details to reach n8n API "
      }
    },
    {
      "id": "2458b279-0dc8-41d5-ae57-961eeb0d3a48",
      "name": "If resource == \"folder\"",
      "type": "n8n-nodes-base.if",
      "position": [
        2640,
        1552
      ]
    },
    {
      "id": "d45b0f7f-499e-4638-88a2-9089d34776a6",
      "name": "Define & assign folder's fullPath value",
      "type": "n8n-nodes-base.code",
      "position": [
        4512,
        288
      ]
    },
    {
      "id": "65acb23a-b3f1-4f5f-9641-62efca36b681",
      "name": "get all workflows",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4208,
        672
      ]
    },
    {
      "id": "6ff3a621-a8d1-49da-b2ab-31abb6ca4d93",
      "name": "extract each workflow",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        4416,
        672
      ]
    },
    {
      "id": "01d1fcaf-66aa-4100-9ee7-b64fad321a02",
      "name": "Create backup folder \"n8n_backup_folder_structure_ddMMyyyy_HHmmss\"",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        4368,
        1536
      ]
    },
    {
      "id": "45df3645-d980-418b-8355-b96a7ec4fca4",
      "name": "Sort to get root folders first",
      "type": "n8n-nodes-base.sort",
      "position": [
        6336,
        1264
      ]
    },
    {
      "id": "38dfeed3-a4f4-475d-aac7-593fb5454ba4",
      "name": "define full_path length",
      "type": "n8n-nodes-base.set",
      "position": [
        6032,
        1520
      ]
    },
    {
      "id": "656779fd-fe59-4e76-99e4-fb3bcb067cc4",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4128,
        1104
      ],
      "parameters": {
        "width": 6336,
        "height": 816,
        "content": "# 6/ Upload the n8n folder structure in gdrive\n\n## + add the \"google_folder_id\" of each folder in table \"folders\". For example :\n- for uploaded folder https://drive.google.com/drive/u/1/folders/1bbirm"
      }
    },
    {
      "id": "36ab2894-d4c1-4c2b-922c-71ec402f2d3c",
      "name": "One run per folder",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        6688,
        1264
      ]
    },
    {
      "id": "87e7360f-76bc-4146-9ff5-3dd1d2fbf4d0",
      "name": "get all workflows1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4224,
        3456
      ]
    },
    {
      "id": "b3f5d6b2-7a76-4098-a347-48a81dbfa73d",
      "name": "keep only workflows not archived",
      "type": "n8n-nodes-base.filter",
      "position": [
        4672,
        672
      ]
    },
    {
      "id": "c1a80b0c-228e-4ecf-99e3-df3b97ddcb9e",
      "name": "keep only workflows not archived1",
      "type": "n8n-nodes-base.filter",
      "position": [
        4720,
        3456
      ]
    },
    {
      "id": "89625ce3-100f-4152-ace9-56121f097d1c",
      "name": "add wf_folder_name",
      "type": "n8n-nodes-base.set",
      "position": [
        5808,
        3472
      ]
    },
    {
      "id": "fc2cf73c-f7ee-4aa2-bc3e-b6641ca9f3fc",
      "name": "remove the [] wrapper to re-create imported wf later",
      "type": "n8n-nodes-base.code",
      "position": [
        7232,
        3536
      ]
    },
    {
      "id": "5726303d-887a-4b09-83e3-36e730f7c69e",
      "name": "n8n-auth for n8n API",
      "type": "n8n-nodes-base.set",
      "position": [
        -816,
        1552
      ]
    },
    {
      "id": "73ee2d7c-588c-4a84-abc7-dde1f4bdc555",
      "name": "Convert workflow to JSON file",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        7696,
        3392
      ]
    },
    {
      "id": "e2f5dd2e-a15f-43f6-bc77-93e5265393b7",
      "name": "Upload file to gdrive main root folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        8528,
        3232
      ]
    },
    {
      "id": "e68961c1-711b-46b0-9d93-e16f2b5355cb",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2960,
        960
      ],
      "parameters": {
        "width": 784,
        "height": 1120,
        "content": "## Backup n8n workflows to Google Drive with automatic cleanup\n\nThis template solves that for any n8n setup (cloud or self hosted)  by exporting a perfect mirrored setup of a whole n8n project, preser"
      }
    },
    {
      "id": "a9bef7ed-8dbf-4489-9bc5-0a40e8f88b9e",
      "name": "n8n instance/project access details",
      "type": "n8n-nodes-base.set",
      "position": [
        -1616,
        1552
      ]
    },
    {
      "id": "fb42ecff-2dd5-4a19-95d5-6a6f0d156e37",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1696,
        1440
      ],
      "parameters": {
        "width": 288,
        "height": 272,
        "content": "## Add your n8n URL and credentials here\n### URL without the \"/\" at the end\n"
      }
    },
    {
      "id": "8d75988b-5576-40ab-aaa7-7a30da5aad8e",
      "name": "create n8n table \"folders\"",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -48,
        432
      ]
    },
    {
      "id": "7bc553d7-970f-4dc8-bf19-5939abea778f",
      "name": "create n8n table \"workflows\"",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -16,
        1008
      ]
    },
    {
      "id": "b4a7e1be-bc6b-4761-af75-b2bb1d00fd47",
      "name": "\"folders\" table columns list",
      "type": "n8n-nodes-base.code",
      "position": [
        240,
        416
      ]
    },
    {
      "id": "de321963-c45a-4fd3-90fc-efd6eae97b06",
      "name": "\"workflows\" table columns list",
      "type": "n8n-nodes-base.code",
      "position": [
        256,
        992
      ]
    },
    {
      "id": "8c95042f-8f0a-4f69-a3fe-4fd9c4b69cd4",
      "name": "get projectId",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -368,
        736
      ]
    },
    {
      "id": "cf783ab7-0a11-4235-8333-6cfc6f19d3aa",
      "name": "add columns to \"folders\" table",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        480,
        416
      ]
    },
    {
      "id": "1e4fafc0-9b2c-4661-9be0-cdda751295f7",
      "name": "add columns to \"workflows\" table",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        496,
        992
      ]
    },
    {
      "id": "bd3cb1e9-1d82-4900-8e28-749343a54d54",
      "name": "get all folders2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4704,
        1536
      ]
    },
    {
      "id": "cf09abcd-e6e7-4641-b5b2-78264862a748",
      "name": "add backup_folder google_id to \"folders\"",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        5072,
        1344
      ]
    },
    {
      "id": "7d79dd27-7ead-4b58-8ab8-0debbcfba98e",
      "name": "Add data about folder : google_folder_id1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        9296,
        1248
      ]
    },
    {
      "id": "68d58f53-8ae4-41a0-8a9b-f5d22db1cf37",
      "name": "get  parent_google_folderid value",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        8592,
        1568
      ]
    },
    {
      "id": "6a72ebb4-6a7a-4f7d-9ac9-5cbc4c1c4d47",
      "name": "get all folders1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4400,
        2400
      ]
    },
    {
      "id": "42290115-47b5-4d09-8e48-1d05a2086646",
      "name": "parentFolder",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        5360,
        2416
      ]
    },
    {
      "id": "9749f0ab-14b8-4b0c-bff4-fa8c35739327",
      "name": "Upsert row(s)4",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6400,
        2272
      ]
    },
    {
      "id": "c39f04e5-f3f4-48bc-8c44-89870fae0564",
      "name": "Upsert row(s)5",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6400,
        2624
      ]
    },
    {
      "id": "79118ed9-311a-4831-a3f1-cc10cfdf44d6",
      "name": "Get row(s)3",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        5936,
        3168
      ]
    },
    {
      "id": "d9cacfde-e1d4-43d0-9e0c-8e71e2745359",
      "name": "get main root folder details1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6208,
        3296
      ]
    },
    {
      "id": "67650eaf-a553-4787-be4c-0609123b6599",
      "name": "get related folder details1",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        5664,
        3648
      ]
    },
    {
      "id": "c089de7b-f0cc-44be-a105-a5c00bded8d4",
      "name": "add workflow file and folder google IDs2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        8736,
        3232
      ]
    },
    {
      "id": "692717e1-1000-453e-a35a-702b217e44a4",
      "name": "add workflow file and folder google IDs",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        8752,
        3600
      ]
    },
    {
      "id": "fa522ce7-52e6-4301-9374-760dbb690e97",
      "name": "Add data about folder : google_folder_id",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        9632,
        1552
      ]
    },
    {
      "id": "25920db2-95d5-4285-bb34-2c1c490650cf",
      "name": "exclude field \"id\"",
      "type": "n8n-nodes-base.set",
      "position": [
        6096,
        3648
      ]
    },
    {
      "id": "9e442d49-84c1-4b98-aa10-07760d7ecab6",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        336
      ],
      "parameters": {
        "width": 1648,
        "height": 1232,
        "content": "# 2/ Create the n8n data tables \"folders\" & \"workflows\""
      }
    },
    {
      "id": "14f6b693-de61-4f26-972e-d013813724c2",
      "name": "Purge data in \"folders\"",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        736,
        816
      ]
    },
    {
      "id": "54a7a89c-a608-447d-a12a-b6996c99d7dd",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1328,
        1328
      ],
      "parameters": {
        "width": 672,
        "height": 416,
        "content": "## Connect to the account using API to get the \"set-cookie\" token value returned from the header that will later be used to authenticate with n8n API : \n\n### {{ $json.headers[\"set-cookie\"][0] }}\n"
      }
    },
    {
      "id": "395787c1-1e13-4cdd-ae33-949af45ea5f0",
      "name": "Sticky Note18",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        -64
      ],
      "parameters": {
        "width": 912,
        "height": 320,
        "content": "## n8n tables used to store the folder/subfolders and workflow structure details\n\n### We use n8n table instead of google sheet because gsheet has a very limitative API quotas limit that will slow down"
      }
    },
    {
      "id": "2c8ee5f1-a507-4263-afc8-fea656bcebe2",
      "name": "Insert data into table \"folders\"",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3360,
        1536
      ]
    },
    {
      "id": "64c1844c-2afb-4119-ab44-b9d7312cc052",
      "name": "Get all folders",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4224,
        288
      ]
    },
    {
      "id": "41015570-7c84-4493-8f74-1ed251a0c419",
      "name": "Insert \"full_path\" value for each folder",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4736,
        288
      ]
    },
    {
      "id": "3c477538-37a7-4451-a78a-0c2665244fe8",
      "name": "Match workflow with folder details",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        5456,
        784
      ]
    },
    {
      "id": "836e8a0b-c86e-49ae-85f8-5ec2a1cec622",
      "name": "Insert workflow details into \"workflows\" table",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6720,
        688
      ]
    },
    {
      "id": "6d3103f3-31f8-4d87-bd4e-40c7048d920c",
      "name": "Sticky Note19",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5376,
        1168
      ],
      "parameters": {
        "width": 1216,
        "height": 640,
        "content": "## We order the folders to be created on google drive by ascending order based on \"full_path\" length value : \n\n### The smallest full_path length will be the first.\n### We start from the top root folde"
      }
    },
    {
      "id": "0f646608-4b00-40e6-89ee-aa9077c321fc",
      "name": "Get the parentFolderName if it exists",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6960,
        1280
      ]
    },
    {
      "id": "ead02659-2a0f-4c56-8620-81ec1f4e6422",
      "name": "get parentFolderId if it exists",
      "type": "n8n-nodes-base.set",
      "position": [
        7200,
        1280
      ]
    },
    {
      "id": "18cc8db2-c9b2-43ec-bb84-1a4d7546f96a",
      "name": "Sticky Note20",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6352,
        2128
      ],
      "parameters": {
        "width": 1024,
        "height": 640,
        "content": "## We get the id of each created folder into google drive (previous step) and assign the value to corresponding folder name in \"folders\" table\n\n"
      }
    },
    {
      "id": "df2a8006-8076-4791-94fb-9e5adae5494d",
      "name": "Sticky Note21",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5216,
        2960
      ],
      "parameters": {
        "width": 3648,
        "height": 80,
        "content": "## Branch for workflow(s) at the main_root of your project"
      }
    },
    {
      "id": "7d5c332e-8d41-4a1b-a08a-3ed33035a297",
      "name": "Sticky Note22",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5232,
        3808
      ],
      "parameters": {
        "width": 3664,
        "height": 80,
        "content": "## Branch for workflow(s) under at list one folder of your project"
      }
    },
    {
      "id": "14bdc57e-91cb-4e87-aba5-0d5858c64e16",
      "name": "Get each workflow JSON data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6960,
        3408
      ]
    },
    {
      "id": "f97cc0df-1f4f-4138-bf89-18a1aea5e960",
      "name": "GET each workflow JSON data",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        4976,
        672
      ]
    },
    {
      "id": "ffe8be60-2635-4247-b9cc-1f5e2ef3c703",
      "name": "Aggregate",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        5296,
        3184
      ]
    },
    {
      "id": "528c76cf-557c-4d44-930d-9dd37870bba0",
      "name": "Insert one row in \"folders\" for the main_root_backup_folder",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6192,
        3088
      ]
    },
    {
      "id": "26d9b7a8-e22a-44d5-a02b-5865bae15520",
      "name": "get n8n table \"id\"",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        112,
        720
      ]
    },
    {
      "id": "0da91566-fd00-4cd1-9ee2-0182c90fb1b4",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        320,
        720
      ]
    },
    {
      "id": "5e324f9d-ab7c-4c6a-9a2a-aa7ede099737",
      "name": "get n8n table \"id\"1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        128,
        1296
      ]
    },
    {
      "id": "0207ddc8-c5f6-46b0-8e1d-1a52f2f24390",
      "name": "Split Out2",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        336,
        1296
      ]
    },
    {
      "id": "a7b04bc5-d245-478b-95cd-db8946651fe8",
      "name": "Filter on \"folders\" table",
      "type": "n8n-nodes-base.filter",
      "position": [
        528,
        720
      ]
    },
    {
      "id": "64bfc972-3af4-4c85-9f7f-aa040f9100c0",
      "name": "Filter on \"workflows\" table",
      "type": "n8n-nodes-base.filter",
      "position": [
        544,
        1296
      ]
    },
    {
      "id": "1c77ffa4-53dc-4f62-be3c-9e56e0d26641",
      "name": "Purge data in \"workflows\"",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        736,
        1376
      ]
    },
    {
      "id": "74a3883d-256c-4368-a4c8-d623df77b62e",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        5712,
        3184
      ]
    },
    {
      "id": "bc261575-bc82-492e-8f79-a36812dcea7f",
      "name": "one item per workflow at main_root_folder",
      "type": "n8n-nodes-base.code",
      "position": [
        5488,
        3184
      ]
    },
    {
      "id": "7d5d12df-02c0-4731-8a36-e9398d2f6c2c",
      "name": "Sticky Note23",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4176,
        1424
      ],
      "parameters": {
        "width": 496,
        "height": 288,
        "content": "## Create manually your google drive folder \"backup_n8n\" and select it in this node"
      }
    },
    {
      "id": "76f50143-d853-44e5-9d42-3ace0dae154d",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1264,
        384
      ],
      "parameters": {
        "width": 512,
        "height": 944,
        "content": "## Capture both n8n dataTableId for \"folders\" and \"workflows\" to be used later on in n8n \"data table\" nodes to refer each table"
      }
    },
    {
      "id": "b25d18ce-029f-4c48-a5e4-fd75c8a65006",
      "name": "Sticky Note24",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4160,
        4176
      ],
      "parameters": {
        "width": 1232,
        "height": 640,
        "content": "## 9/ Save n8n tables data \"workflows\" and \"folders\" to gsheet \"workflows_folders_backup_details\"\n"
      }
    },
    {
      "id": "1d687981-ae13-47ed-b1b3-c464833f24e1",
      "name": "Create gsheet \"workflows_folders_backup_details\"",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4208,
        4400
      ]
    },
    {
      "id": "7342c752-21ba-4055-95fd-f61f78c222fd",
      "name": "Move file to backup drive folder",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        4688,
        4400
      ]
    },
    {
      "id": "ff701cb3-e783-455a-801b-0d97945b1476",
      "name": "folders details",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4960,
        4608
      ]
    },
    {
      "id": "524a13ef-65f4-439d-88f1-3df930762891",
      "name": "workflows details",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4960,
        4304
      ]
    },
    {
      "id": "beefe391-c212-4764-b965-2fa98b09c3c3",
      "name": "Get \"main_root_folder_google_folder_id\"",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4448,
        4400
      ]
    },
    {
      "id": "29e6d79b-d194-4014-b079-240f67be8339",
      "name": "Copy data to sheet \"workflows\"",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5184,
        4304
      ]
    },
    {
      "id": "d0b3ddbf-8eb5-4d47-bb76-501cbf21392f",
      "name": "Copy data to sheet \"folders\"",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        5200,
        4608
      ]
    },
    {
      "id": "33b7a182-591d-44bc-b6d7-7e89aba0d033",
      "name": "n8n login API2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -1408,
        6848
      ]
    },
    {
      "id": "817d14b5-197d-49e1-bc4f-0cf5146f2ebf",
      "name": "create n8n table \"folders_restore_backup\"",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -368,
        5856
      ]
    },
    {
      "id": "cad1cfb6-5345-4ad8-9b0b-0121f8032e3b",
      "name": "\"folders_restore_backup\" table columns list",
      "type": "n8n-nodes-base.code",
      "position": [
        -80,
        5840
      ]
    },
    {
      "id": "8d397f09-14b0-4785-96a9-5119fac7c9ac",
      "name": "add columns to \"folders_restore_backup\" table",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        160,
        5840
      ]
    },
    {
      "id": "afabb327-8c56-439b-9486-aa3e1c6f224c",
      "name": "Filter on \"folders_restore_backup\" table",
      "type": "n8n-nodes-base.filter",
      "position": [
        208,
        6144
      ]
    },
    {
      "id": "fa6ed469-3d81-46ec-8944-190117a6c34f",
      "name": "Purge data in \"folders_restore_backup\"",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        432,
        6144
      ]
    },
    {
      "id": "1ba9e148-396d-4d09-84e7-433d2a8acf3b",
      "name": "Insert data into table \"folders_restore_backup\"",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2656,
        6848
      ]
    },
    {
      "id": "046cba97-03c8-4aec-90a9-2e39544b84b3",
      "name": "fullPath length1",
      "type": "n8n-nodes-base.set",
      "position": [
        2928,
        6848
      ]
    },
    {
      "id": "af3438d2-908c-42fd-8d09-436bc1073cdc",
      "name": "Filter",
      "type": "n8n-nodes-base.filter",
      "position": [
        3136,
        6848
      ]
    },
    {
      "id": "8997d76f-fb82-4ca7-89d7-91524598978d",
      "name": "Aggregate1",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        4256,
        6208
      ]
    },
    {
      "id": "c1331a00-f6cc-4481-a28e-fa9a748a2117",
      "name": "Attach the parentFolder if any1",
      "type": "n8n-nodes-base.set",
      "position": [
        4592,
        6864
      ]
    },
    {
      "id": "126f263b-1301-49b0-9492-2f63f39d066f",
      "name": "if parentFolder empty1",
      "type": "n8n-nodes-base.if",
      "position": [
        4880,
        6864
      ]
    },
    {
      "id": "3a681901-6b7f-42bb-818c-54cf427b180f",
      "name": "One run per folder1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3712,
        6848
      ]
    },
    {
      "id": "bf94978e-9529-4653-b81c-b90d21b54ea1",
      "name": "Get the parentFolderName if it exists2",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        3920,
        6864
      ]
    },
    {
      "id": "f396238b-4bcb-44df-b422-594af2bcb09a",
      "name": "get parentFolderId if it exists1",
      "type": "n8n-nodes-base.set",
      "position": [
        4224,
        6864
      ]
    },
    {
      "id": "c0683642-e8bc-420d-8cec-82c8276c2f99",
      "name": "Get the parentFolderName if it exists3",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        5152,
        7152
      ]
    },
    {
      "id": "6fab7ef8-64a2-4af9-b6a8-02bb1dc3a07c",
      "name": "Merge7",
      "type": "n8n-nodes-base.merge",
      "position": [
        5392,
        7136
      ]
    },
    {
      "id": "88cbfe1f-457c-4799-93de-4ddd420162de",
      "name": "create n8n folder3",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5216,
        6848
      ]
    },
    {
      "id": "c9ed81d3-b656-453b-9d2d-9fb89cbdb181",
      "name": "Upsert row(s)3",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        5760,
        6848
      ]
    },
    {
      "id": "1837235c-ae24-426d-aa8e-175becd977d1",
      "name": "create n8n folder4",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        5920,
        7136
      ]
    },
    {
      "id": "dd05dac2-12f0-4655-bbd0-235ae2e42ceb",
      "name": "add \"active\" key to JSON : mandatory1",
      "type": "n8n-nodes-base.code",
      "position": [
        6112,
        6224
      ]
    },
    {
      "id": "2316b9db-4dce-4fd6-8c8f-676539d675f3",
      "name": "create main backup n8n folder",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1520,
        6848
      ]
    },
    {
      "id": "84e9b253-85ed-40f8-bcca-9e54fa1d6549",
      "name": "Create workflow JSON file into backup n8n folder",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        6640,
        6224
      ]
    },
    {
      "id": "92c23b5d-0b08-4cd5-98f3-719cd14ce553",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        416,
        6848
      ]
    },
    {
      "id": "a3344807-656e-49e6-b4fa-d0f2787dad7f",
      "name": "exclude \"main_root_backup_folder\"",
      "type": "n8n-nodes-base.filter",
      "position": [
        2128,
        6848
      ]
    },
    {
      "id": "439bfe3b-85a4-45cd-b089-d27cadc627ec",
      "name": "Search for the backup folder in Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -400,
        6848
      ]
    },
    {
      "id": "eeb468dd-8cee-4e78-90f0-5fce9f988e4f",
      "name": "Get related gsheet \"workflows_folders_backup_details\"",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        80,
        6848
      ]
    },
    {
      "id": "19983255-1ca4-4f83-80cd-8934705c9689",
      "name": "Order by full_path length ASC",
      "type": "n8n-nodes-base.sort",
      "position": [
        3392,
        6848
      ]
    },
    {
      "id": "c1582f1e-fef1-4cb7-8968-eecf622d787f",
      "name": "Get all n8n folders from the backup",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1888,
        6848
      ]
    },
    {
      "id": "b5e1055b-ff08-4f4a-8a94-f555f02212d2",
      "name": "Get workflows details",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4464,
        6208
      ]
    },
    {
      "id": "b0166226-1939-4a2c-9dcd-3ee95dc64367",
      "name": "Get folders_restore_backup details",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4672,
        6384
      ]
    },
    {
      "id": "2028f8a9-1187-4b6a-8bae-7cacdb12cdcd",
      "name": "Download JSON wf files",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        5344,
        6224
      ]
    },
    {
      "id": "6089ae02-8683-4faf-8ea3-3d2eb8236eed",
      "name": "Extract JSON from files",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        5552,
        6224
      ]
    },
    {
      "id": "eebd7a1a-961c-42c8-96d9-cc1e1c3674c3",
      "name": "exclude some fields before create workflow",
      "type": "n8n-nodes-base.set",
      "position": [
        5776,
        6224
      ]
    },
    {
      "id": "b64560b1-7ecb-4dc8-b0b6-2b9ea7a64cb7",
      "name": "rename fields8",
      "type": "n8n-nodes-base.set",
      "position": [
        2368,
        6848
      ]
    },
    {
      "id": "57d44c9d-6809-4d64-a7b0-007e7319a527",
      "name": "Sticky Note25",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1936,
        6512
      ],
      "parameters": {
        "width": 1104,
        "height": 576,
        "content": "# 1/ Initialize n8n instance access details to reach n8n API "
      }
    },
    {
      "id": "3cebc89d-c32e-4b24-ad95-fe5b2fd5aefa",
      "name": "n8n-auth for n8n API1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1040,
        6848
      ]
    },
    {
      "id": "315d6cfe-e2ea-4804-9c47-6390d489471a",
      "name": "n8n instance/project access details1",
      "type": "n8n-nodes-base.set",
      "position": [
        -1840,
        6848
      ]
    },
    {
      "id": "4686595a-830a-422e-bb0f-dd253453c9be",
      "name": "Sticky Note26",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1920,
        6736
      ],
      "parameters": {
        "width": 288,
        "height": 272,
        "content": "## Add your n8n URL and credentials here\n### URL without the \"/\" at the end\n"
      }
    },
    {
      "id": "ac0ea032-d41c-44f6-ad24-373fdd153bbc",
      "name": "get projectId1",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -688,
        6160
      ]
    },
    {
      "id": "8dddd12b-fb44-476f-93d8-0033c05bfb0d",
      "name": "Sticky Note27",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        5760
      ],
      "parameters": {
        "width": 1856,
        "height": 672,
        "content": "# 2/ Create the n8n data tables \"folders_restore_backup\""
      }
    },
    {
      "id": "fe1a14eb-ea3c-4bd0-9712-09eff2371018",
      "name": "Sticky Note28",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1552,
        6624
      ],
      "parameters": {
        "width": 672,
        "height": 416,
        "content": "## Connect to the account using API to get the \"set-cookie\" token value returned from the header that will later be used to authenticate with n8n API : \n\n### {{ $json.headers[\"set-cookie\"][0] }}\n"
      }
    },
    {
      "id": "9ad4d303-9645-48f7-92b7-a68e6642a023",
      "name": "Sticky Note29",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -288,
        5392
      ],
      "parameters": {
        "width": 912,
        "height": 320,
        "content": "## n8n tables used to store the folder/subfolders and workflow structure details\n\n### We use n8n table instead of google sheet because gsheet has a very limitative API quotas limit that will slow down"
      }
    },
    {
      "id": "7933993d-9b57-4221-bec1-674095acaab5",
      "name": "get n8n table \"id\"2",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -208,
        6144
      ]
    },
    {
      "id": "e9c6f851-7f4e-405d-ac69-817445f1a23b",
      "name": "Split Out4",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        0,
        6144
      ]
    },
    {
      "id": "bff5b16c-8e33-4284-b708-0253fc9409ac",
      "name": "rename fields9",
      "type": "n8n-nodes-base.set",
      "position": [
        5552,
        6848
      ]
    },
    {
      "id": "00f317de-8427-4611-a41f-cecbecc99535",
      "name": "rename fields10",
      "type": "n8n-nodes-base.set",
      "position": [
        5680,
        7136
      ]
    },
    {
      "id": "657bf4ad-7bd5-49ff-ad9a-3ad1f9b8e455",
      "name": "rename fields11",
      "type": "n8n-nodes-base.set",
      "position": [
        6160,
        7136
      ]
    },
    {
      "id": "575defdc-e22c-452b-9182-246ff02812f9",
      "name": "Upsert row(s)",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        6400,
        7136
      ]
    },
    {
      "id": "c4063146-2e4a-46f6-9bbf-e2a5ea5aba2b",
      "name": "Merge8",
      "type": "n8n-nodes-base.merge",
      "position": [
        4864,
        6224
      ]
    },
    {
      "id": "52a1f2a5-5050-4ed2-8f1a-95b60818c555",
      "name": "Remove Duplicates3",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        5120,
        6224
      ]
    },
    {
      "id": "9f65e021-8702-434f-8fba-7e0615a9327b",
      "name": "Aggregate4",
      "type": "n8n-nodes-base.aggregate",
      "position": [
        1104,
        6848
      ]
    },
    {
      "id": "8b27110f-630b-4fe2-ad86-8ccfac27698b",
      "name": "Sticky Note30",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -480,
        6688
      ],
      "parameters": {
        "width": 368,
        "height": 336,
        "content": "## Specify the exact drive backup folder name to restore"
      }
    },
    {
      "id": "dce18062-35d2-4794-91d2-924db4f8393c",
      "name": "Sticky Note31",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6000,
        6896
      ],
      "parameters": {
        "width": 336,
        "height": 80,
        "content": "## root folder(s) : full_path = 1"
      }
    },
    {
      "id": "68f8a397-4180-445e-b1f6-ab42dd0f9cd7",
      "name": "Sticky Note32",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6624,
        7200
      ],
      "parameters": {
        "width": 352,
        "height": 96,
        "content": "## subfolders : full_path>1"
      }
    },
    {
      "id": "5a0fcadd-7b9c-4011-83a3-d723400a5612",
      "name": "Sticky Note33",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        6688
      ],
      "parameters": {
        "width": 544,
        "height": 336,
        "content": "## Gets the related gsheet \"workflows_folders_backup_details\""
      }
    },
    {
      "id": "2198184f-d96f-4efe-b2f6-5eb800f82b35",
      "name": "Sticky Note34",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3600,
        6720
      ],
      "parameters": {
        "width": 3408,
        "height": 656,
        "content": "## 3/ Creates the folder/subfolder structure under main folder \"backup restored\" on n8n"
      }
    },
    {
      "id": "f3129b8c-a2d6-4991-8b2b-af7eaaa6560c",
      "name": "Sticky Note35",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4400,
        6032
      ],
      "parameters": {
        "width": 2528,
        "height": 528,
        "content": "## 4/ Download workflow JSON files from GDrive back and upload them into their folder in n8n"
      }
    },
    {
      "id": "74da16f9-0e59-40f6-afca-4b67bfa4f4c2",
      "name": "Sticky Note36",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        6416,
        6048
      ],
      "parameters": {
        "width": 496,
        "height": 384,
        "content": "## Create the workflow under its n8n folder along with their \"tags\" and \"description\"\n"
      }
    },
    {
      "id": "fe14b8ab-046c-4819-80cf-145f1936b129",
      "name": "Sticky Note37",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        5984,
        6048
      ],
      "parameters": {
        "width": 400,
        "height": 512,
        "content": "## Add to the JSON workflow data : \n\n### - set active to \"false\"\n### - workflow name\n### - parentFolder name"
      }
    },
    {
      "id": "94a59236-4f4a-4023-a111-ca3474a125c4",
      "name": "Sticky Note38",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2928,
        -800
      ],
      "parameters": {
        "width": 13120,
        "height": 192,
        "content": "# Backup workflows solution to google Drive"
      }
    },
    {
      "id": "e01e0c96-b0d5-486c-9930-a97774267587",
      "name": "Sticky Note39",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1856,
        5072
      ],
      "parameters": {
        "width": 13120,
        "height": 192,
        "content": "# Restore Backup workflows to n8n from google Drive"
      }
    },
    {
      "id": "19af1673-71fc-470c-8bd2-97d8bf578676",
      "name": "Restore workflows trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2176,
        6848
      ]
    },
    {
      "id": "99a82cbd-94ba-4054-82e6-d887ff5b0304",
      "name": "Backup workflows scheduler",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -2064,
        1552
      ]
    },
    {
      "id": "293bd39e-4dbe-4987-bd86-3be44312ad21",
      "name": "Sticky Note40",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1312,
        6688
      ],
      "parameters": {
        "width": 496,
        "height": 336,
        "content": "## Creates \"backup restored\" folder on n8n"
      }
    }
  ],
  "connections": {
    "Merge": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter": {
      "main": [
        [
          {
            "node": "Order by full_path length ASC",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge1": {
      "main": [
        [
          {
            "node": "Remove Duplicates2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge2": {
      "main": [
        [
          {
            "node": "Convert workflow to JSON file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge3": {
      "main": [
        [
          {
            "node": "define full_path length",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge4": {
      "main": [
        [
          {
            "node": "Remove Duplicates1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge5": {
      "main": [
        [
          {
            "node": "rename fields7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge6": {
      "main": [
        [
          {
            "node": "Create folder under the parentFolder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge7": {
      "main": [
        [
          {
            "node": "rename fields10",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge8": {
      "main": [
        [
          {
            "node": "Remove Duplicates3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate": {
      "main": [
        [
          {
            "node": "one item per workflow at main_root_folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Filter on \"folders\" table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate1": {
      "main": [
        [
          {
            "node": "Get workflows details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate3": {
      "main": [
        [
          {
            "node": "get all workflows",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get all folders",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create backup folder \"n8n_backup_folder_structure_ddMMyyyy_HHmmss\"",
            "type": "main",
            "index": 0
          },
          {
            "node": "get all folders1",
            "type": "main",
            "index": 0
          },
          {
            "node": "get all workflows1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Create gsheet \"workflows_folders_backup_details\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Aggregate4": {
      "main": [
        [
          {
            "node": "create main backup n8n folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out1": {
      "main": [
        [
          {
            "node": "If resource == \"folder\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out2": {
      "main": [
        [
          {
            "node": "Filter on \"workflows\" table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out3": {
      "main": [
        [
          {
            "node": "keep only workflows not archived1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out4": {
      "main": [
        [
          {
            "node": "Filter on \"folders_restore_backup\" table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s)3": {
      "main": [
        [
          {
            "node": "Insert one row in \"folders\" for the main_root_backup_folder",
            "type": "main",
            "index": 0
          },
          {
            "node": "get main root folder details1",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parentFolder": {
      "main": [
        [
          {
            "node": "rename fields5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert row(s)": {
      "main": [
        [
          {
            "node": "One run per folder1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get projectId": {
      "main": [
        [
          {
            "node": "create n8n table \"folders\"",
            "type": "main",
            "index": 0
          },
          {
            "node": "create n8n table \"workflows\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields": {
      "main": [
        [
          {
            "node": "Insert workflow details into \"workflows\" table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert row(s)3": {
      "main": [
        [
          {
            "node": "One run per folder1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get projectId1": {
      "main": [
        [
          {
            "node": "create n8n table \"folders_restore_backup\"",
            "type": "main",
            "index": 0
          },
          {
            "node": "Search for the backup folder in Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n login API1": {
      "main": [
        [
          {
            "node": "n8n-auth for n8n API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n login API2": {
      "main": [
        [
          {
            "node": "n8n-auth for n8n API1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields1": {
      "main": [
        [
          {
            "node": "Insert data into table \"folders\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields2": {
      "main": [
        [
          {
            "node": "Add data about folder : google_folder_id1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields3": {
      "main": [
        [
          {
            "node": "Add data about folder : google_folder_id",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields4": {
      "main": [
        [
          {
            "node": "Upsert row(s)5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields5": {
      "main": [
        [
          {
            "node": "Merge4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields6": {
      "main": [
        [
          {
            "node": "Upsert row(s)4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields7": {
      "main": [
        [
          {
            "node": "Get each workflow JSON data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields8": {
      "main": [
        [
          {
            "node": "Insert data into table \"folders_restore_backup\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields9": {
      "main": [
        [
          {
            "node": "Upsert row(s)3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all folders": {
      "main": [
        [
          {
            "node": "Define & assign folder's fullPath value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [
          {
            "node": "Get row(s)3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "folders details": {
      "main": [
        [
          {
            "node": "Copy data to sheet \"folders\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields10": {
      "main": [
        [
          {
            "node": "create n8n folder4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename fields11": {
      "main": [
        [
          {
            "node": "Upsert row(s)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "wf_id + wf_name": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fullPath length1": {
      "main": [
        [
          {
            "node": "Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get all folders1": {
      "main": [
        [
          {
            "node": "get directParentFolderName",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get all folders2": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 1
          },
          {
            "node": "rename main_root_folder fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "rename fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get all workflows": {
      "main": [
        [
          {
            "node": "extract each workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "workflows details": {
      "main": [
        [
          {
            "node": "Copy data to sheet \"workflows\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "One run per folder": {
      "main": [
        [],
        [
          {
            "node": "Get the parentFolderName if it exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates1": {
      "main": [
        [
          {
            "node": "rename fields4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates2": {
      "main": [
        [
          {
            "node": "Get each workflow JSON data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates3": {
      "main": [
        [
          {
            "node": "Download JSON wf files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add wf_folder_name": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create n8n folder3": {
      "main": [
        [
          {
            "node": "rename fields9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create n8n folder4": {
      "main": [
        [
          {
            "node": "rename fields11",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "exclude field \"id\"": {
      "main": [
        [
          {
            "node": "Merge1",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "get all workflows1": {
      "main": [
        [
          {
            "node": "Split Out3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get n8n table \"id\"": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Aggregate4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "One run per folder1": {
      "main": [
        [
          {
            "node": "Aggregate1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get the parentFolderName if it exists2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get n8n table \"id\"1": {
      "main": [
        [
          {
            "node": "Split Out2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get n8n table \"id\"2": {
      "main": [
        [
          {
            "node": "Split Out4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n-auth for n8n API": {
      "main": [
        [
          {
            "node": "get projectId",
            "type": "main",
            "index": 0
          },
          {
            "node": "get subfolder(s) structure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get workflows details": {
      "main": [
        [
          {
            "node": "Get folders_restore_backup details",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract each workflow": {
      "main": [
        [
          {
            "node": "keep only workflows not archived",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if parentFolder empty": {
      "main": [
        [
          {
            "node": "Create folder under the static \"backup_n8n\" folder",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge6",
            "type": "main",
            "index": 0
          },
          {
            "node": "get  parent_google_folderid value",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n-auth for n8n API1": {
      "main": [
        [
          {
            "node": "get projectId1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download JSON wf files": {
      "main": [
        [
          {
            "node": "Extract JSON from files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if parentFolder empty1": {
      "main": [
        [
          {
            "node": "create n8n folder3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get the parentFolderName if it exists3",
            "type": "main",
            "index": 0
          },
          {
            "node": "Merge7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract JSON from files": {
      "main": [
        [
          {
            "node": "exclude some fields before create workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If parentFolder is null": {
      "main": [
        [
          {
            "node": "root folder : backup_n8n",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "root folder : backup_n8n1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If resource == \"folder\"": {
      "main": [
        [
          {
            "node": "rename fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "define full_path length": {
      "main": [
        [
          {
            "node": "Sort to get root folders first",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split root vs subfolders": {
      "main": [
        [
          {
            "node": "rename fields6",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge4",
            "type": "main",
            "index": 1
          },
          {
            "node": "parentFolder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "root folder : backup_n8n": {
      "main": [
        [
          {
            "node": "Upload file to gdrive main root folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter on \"folders\" table": {
      "main": [
        [
          {
            "node": "Purge data in \"folders\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Restore workflows trigger": {
      "main": [
        [
          {
            "node": "n8n instance/project access details1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload file to its folder": {
      "main": [
        [
          {
            "node": "add workflow file and folder google IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "root folder : backup_n8n1": {
      "main": [
        [
          {
            "node": "Upload file to its folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup workflows scheduler": {
      "main": [
        [
          {
            "node": "n8n instance/project access details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create n8n table \"folders\"": {
      "main": [
        [
          {
            "node": "\"folders\" table columns list",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "get n8n table \"id\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get directParentFolderName": {
      "main": [
        [
          {
            "node": "Split root vs subfolders",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get subfolder(s) structure": {
      "main": [
        [
          {
            "node": "Split Out1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter on \"workflows\" table": {
      "main": [
        [
          {
            "node": "Purge data in \"workflows\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "GET each workflow JSON data": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          },
          {
            "node": "Match workflow with folder details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get each workflow JSON data": {
      "main": [
        [
          {
            "node": "wf_id + wf_name",
            "type": "main",
            "index": 0
          },
          {
            "node": "remove the [] wrapper to re-create imported wf later",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get related folder details1": {
      "main": [
        [
          {
            "node": "exclude field \"id\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\"folders\" table columns list": {
      "main": [
        [
          {
            "node": "add columns to \"folders\" table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create n8n table \"workflows\"": {
      "main": [
        [
          {
            "node": "\"workflows\" table columns list",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "get n8n table \"id\"1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert workflow to JSON file": {
      "main": [
        [
          {
            "node": "If parentFolder is null",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Order by full_path length ASC": {
      "main": [
        [
          {
            "node": "One run per folder1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create main backup n8n folder": {
      "main": [
        [
          {
            "node": "Get all n8n folders from the backup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get main root folder details1": {
      "main": [
        [
          {
            "node": "Merge5",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "\"workflows\" table columns list": {
      "main": [
        [
          {
            "node": "add columns to \"workflows\" table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Attach the parentFolder if any": {
      "main": [
        [
          {
            "node": "if parentFolder empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort to get root folders first": {
      "main": [
        [
          {
            "node": "One run per folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "rename main_root_folder fields": {
      "main": [
        [
          {
            "node": "add backup_folder google_id to \"folders\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Attach the parentFolder if any1": {
      "main": [
        [
          {
            "node": "if parentFolder empty1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If there parentFolder.isEmpty()": {
      "main": [
        [
          {
            "node": "Aggregate",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "add wf_folder_name",
            "type": "main",
            "index": 0
          },
          {
            "node": "get related folder details1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search if folder already exists": {
      "main": [
        [
          {
            "node": "if folder not found => create it",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get parentFolderId if it exists": {
      "main": [
        [
          {
            "node": "Search if folder already exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert data into table \"folders\"": {
      "main": [
        [
          {
            "node": "Aggregate3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Move file to backup drive folder": {
      "main": [
        [
          {
            "node": "workflows details",
            "type": "main",
            "index": 0
          },
          {
            "node": "folders details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get parentFolderId if it exists1": {
      "main": [
        [
          {
            "node": "Attach the parentFolder if any1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "if folder not found => create it": {
      "main": [
        [
          {
            "node": "Attach the parentFolder if any",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "keep only workflows not archived": {
      "main": [
        [
          {
            "node": "GET each workflow JSON data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "exclude \"main_root_backup_folder\"": {
      "main": [
        [
          {
            "node": "rename fields8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "get  parent_google_folderid value": {
      "main": [
        [
          {
            "node": "Merge6",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "keep only workflows not archived1": {
      "main": [
        [
          {
            "node": "If there parentFolder.isEmpty()",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get folders_restore_backup details": {
      "main": [
        [
          {
            "node": "Merge8",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Match workflow with folder details": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get all n8n folders from the backup": {
      "main": [
        [
          {
            "node": "exclude \"main_root_backup_folder\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n instance/project access details": {
      "main": [
        [
          {
            "node": "n8n login API1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create folder under the parentFolder": {
      "main": [
        [
          {
            "node": "rename fields3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "n8n instance/project access details1": {
      "main": [
        [
          {
            "node": "n8n login API2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the parentFolderName if it exists": {
      "main": [
        [
          {
            "node": "get parentFolderId if it exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search for the backup folder in Drive": {
      "main": [
        [
          {
            "node": "Get related gsheet \"workflows_folders_backup_details\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add \"active\" key to JSON : mandatory1": {
      "main": [
        [
          {
            "node": "Create workflow JSON file into backup n8n folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the parentFolderName if it exists2": {
      "main": [
        [
          {
            "node": "get parentFolderId if it exists1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get the parentFolderName if it exists3": {
      "main": [
        [
          {
            "node": "Merge7",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Upload file to gdrive main root folder": {
      "main": [
        [
          {
            "node": "add workflow file and folder google IDs2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Define & assign folder's fullPath value": {
      "main": [
        [
          {
            "node": "Insert \"full_path\" value for each folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get \"main_root_folder_google_folder_id\"": {
      "main": [
        [
          {
            "node": "Move file to backup drive folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add data about folder : google_folder_id": {
      "main": [
        [
          {
            "node": "One run per folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter on \"folders_restore_backup\" table": {
      "main": [
        [
          {
            "node": "Purge data in \"folders_restore_backup\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "add backup_folder google_id to \"folders\"": {
      "main": [
        [
          {
            "node": "Merge3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add data about folder : google_folder_id1": {
      "main": [
        [
          {
            "node": "One run per folder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create n8n table \"folders_restore_backup\"": {
      "main": [
        [
          {
            "node": "\"folders_restore_backup\" table columns list",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "get n8n table \"id\"2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "one item per workflow at main_root_folder": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "exclude some fields before create workflow": {
      "main": [
        [
          {
            "node": "add \"active\" key to JSON : mandatory1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\"folders_restore_backup\" table columns list": {
      "main": [
        [
          {
            "node": "add columns to \"folders_restore_backup\" table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Insert data into table \"folders_restore_backup\"": {
      "main": [
        [
          {
            "node": "fullPath length1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create gsheet \"workflows_folders_backup_details\"": {
      "main": [
        [
          {
            "node": "Get \"main_root_folder_google_folder_id\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create folder under the static \"backup_n8n\" folder": {
      "main": [
        [
          {
            "node": "rename fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "remove the [] wrapper to re-create imported wf later": {
      "main": [
        [
          {
            "node": "Merge2",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Get related gsheet \"workflows_folders_backup_details\"": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create backup folder \"n8n_backup_folder_structure_ddMMyyyy_HHmmss\"": {
      "main": [
        [
          {
            "node": "get all folders2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}