{
  "name": "Back up self-hosted workflows to Google Drive daily with change detection",
  "nodes": [
    {
      "id": "c707b367-f88e-448b-b047-ab17e2b3fadd",
      "name": "Daily Backup Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1120,
        112
      ]
    },
    {
      "id": "86434789-a4cb-491b-902d-482e61e8fa7e",
      "name": "Set Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -944,
        112
      ]
    },
    {
      "id": "427ef1c2-e969-4eda-9e35-329dd6a8ec0f",
      "name": "Get All n8n Workflows",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -576,
        128
      ]
    },
    {
      "id": "9dc37605-d398-4e4f-91cd-144c74aa67d0",
      "name": "Prepare Workflow",
      "type": "n8n-nodes-base.code",
      "position": [
        912,
        -48
      ]
    },
    {
      "id": "52e21e29-bec0-4d0c-bcae-e3afa03f72cd",
      "name": "Workflow Exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        1600,
        96
      ]
    },
    {
      "id": "b54e1b3d-9483-44ae-8928-1dcaad66bb24",
      "name": "Hash Changed?",
      "type": "n8n-nodes-base.if",
      "position": [
        1808,
        80
      ]
    },
    {
      "id": "e9c2f658-29a1-4f32-85c2-b18b0225039e",
      "name": "Upload New Workflow Backup",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2320,
        112
      ]
    },
    {
      "id": "7865983d-b69a-4a57-98a5-c5d5c81df19a",
      "name": "Upsert Workflow Records",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2544,
        112
      ]
    },
    {
      "id": "ebe9f41d-187d-445f-ac1c-8dcf49404e12",
      "name": "Split Workflows",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        -400,
        128
      ]
    },
    {
      "id": "a15f6274-1e4b-4924-b6c0-b5437485cfb6",
      "name": "Process Each Workflow",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -240,
        128
      ]
    },
    {
      "id": "fc2b2938-9fd3-4f01-a382-422136254539",
      "name": "Generate Workflow Hash",
      "type": "n8n-nodes-base.crypto",
      "position": [
        1200,
        96
      ]
    },
    {
      "id": "b8d6fee4-7d4a-468f-bff5-145e7bff0a7a",
      "name": "Lookup Workflow in Data Table",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        1408,
        96
      ]
    },
    {
      "id": "120b28b2-84a1-4427-8ce6-66f493f64ccb",
      "name": "Delete Existing Workflow Backup",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        2096,
        112
      ]
    },
    {
      "id": "34af4e1f-8346-4ba5-9724-e00362be3eec",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2096,
        -464
      ],
      "parameters": {
        "width": 880,
        "height": 1312,
        "content": "## Workflow Overview - Daily n8n Workflow Backup to Google Drive (with Change Detection)\n\nThis workflow creates a **daily, automated backup** of all workflows in a self-hosted n8n instance and stores "
      }
    },
    {
      "id": "32b72911-65e7-4e1d-b1d3-f8f6b4e08084",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        -80
      ],
      "parameters": {
        "width": 512,
        "height": 464,
        "content": "## Trigger , Configuration & Validation\nThis section defines when the workflow runs and where all configuration lives.\nThe Cron Trigger controls the daily execution time.\nThe Set Backup Configuration "
      }
    },
    {
      "id": "29ccad62-afd8-4446-917c-1d08313a9c11",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -624,
        -80
      ],
      "parameters": {
        "width": 1696,
        "height": 464,
        "content": "## Workflow Discovery & Looping\nThis section connects to the n8n API and retrieves all existing workflows.\nWorkflows are split into individual items and processed one at a time, ensuring stability eve"
      }
    },
    {
      "id": "ec5f92ec-bbdb-4c3b-8587-693a0cfed690",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        -80
      ],
      "parameters": {
        "width": 864,
        "height": 464,
        "content": "## Hashing & Change Detection\nEach workflow’s JSON is normalized and converted into a SHA-256 hash.\nThis hash acts as a fingerprint for the workflow.\nIf any node, connection, or parameter changes, the"
      }
    },
    {
      "id": "640b325c-d669-42c1-9b24-e84c7add800e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2016,
        -80
      ],
      "parameters": {
        "width": 704,
        "height": 464,
        "content": "## Google Drive Backup & Data Table Updates\n- **New workflow** → upload backup and insert Data Table record.\n- **Changed workflow** → delete existing Google Drive backup, upload the new version, and u"
      }
    },
    {
      "id": "546decbe-3392-4b38-af79-34c30f15bf09",
      "name": "Backup scope all?",
      "type": "n8n-nodes-base.if",
      "position": [
        0,
        144
      ]
    },
    {
      "id": "962efe3c-8dd6-4076-b962-15c23dc9552f",
      "name": "Backup scope active?",
      "type": "n8n-nodes-base.if",
      "position": [
        240,
        176
      ]
    },
    {
      "id": "d188a826-70cf-4488-befd-081d615d3c2c",
      "name": "If workflow active?",
      "type": "n8n-nodes-base.if",
      "position": [
        752,
        48
      ]
    },
    {
      "id": "ff864dfe-6008-4ced-99e2-6197789131e8",
      "name": "Backup scope tagged?",
      "type": "n8n-nodes-base.if",
      "position": [
        576,
        160
      ]
    },
    {
      "id": "8361b04b-9e28-4073-9657-a2087a49be38",
      "name": "Config Validation",
      "type": "n8n-nodes-base.code",
      "position": [
        -784,
        112
      ]
    }
  ],
  "connections": {
    "Hash Changed?": {
      "main": [
        [
          {
            "node": "Delete Existing Workflow Backup",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Process Each Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Workflows": {
      "main": [
        [
          {
            "node": "Process Each Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Workflow": {
      "main": [
        [
          {
            "node": "Generate Workflow Hash",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Exists?": {
      "main": [
        [
          {
            "node": "Hash Changed?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Upload New Workflow Backup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup scope all?": {
      "main": [
        [
          {
            "node": "Prepare Workflow",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Backup scope active?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Config Validation": {
      "main": [
        [
          {
            "node": "Get All n8n Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Configuration": {
      "main": [
        [
          {
            "node": "Config Validation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If workflow active?": {
      "main": [
        [
          {
            "node": "Prepare Workflow",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Process Each Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup scope active?": {
      "main": [
        [
          {
            "node": "If workflow active?",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Backup scope tagged?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Backup scope tagged?": {
      "main": [
        [
          {
            "node": "Prepare Workflow",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Process Each Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Backup Trigger": {
      "main": [
        [
          {
            "node": "Set Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All n8n Workflows": {
      "main": [
        [
          {
            "node": "Split Workflows",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Each Workflow": {
      "main": [
        [],
        [
          {
            "node": "Backup scope all?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Workflow Hash": {
      "main": [
        [
          {
            "node": "Lookup Workflow in Data Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upsert Workflow Records": {
      "main": [
        [
          {
            "node": "Process Each Workflow",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload New Workflow Backup": {
      "main": [
        [
          {
            "node": "Upsert Workflow Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Lookup Workflow in Data Table": {
      "main": [
        [
          {
            "node": "Workflow Exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Existing Workflow Backup": {
      "main": [
        [
          {
            "node": "Upload New Workflow Backup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}