{
  "name": "Back up Instagram videos to Google Drive with JSON metadata catalog",
  "nodes": [
    {
      "id": "b002f21b-0426-4a0d-ae4b-456b353d1b9a",
      "name": "Update JSON Catalog",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        128
      ],
      "parameters": {
        "width": 2056,
        "height": 328,
        "content": "## Update JSON Catalog"
      }
    },
    {
      "id": "f4d4700e-e055-4581-8aa4-9319bceb2d2d",
      "name": "Process Videos",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2864,
        512
      ],
      "parameters": {
        "width": 2056,
        "height": 296,
        "content": "## Process Videos"
      }
    },
    {
      "id": "ff58825b-0663-4acc-a28e-48358b03d0ce",
      "name": "Fetch & Filter",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        528
      ],
      "parameters": {
        "width": 1076,
        "height": 296,
        "content": "## Fetch & Filter"
      }
    },
    {
      "id": "19f3bae2-2df1-47d2-b1b8-39604eb3ceec",
      "name": "Setup Instructions",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 860,
        "height": 900,
        "content": "## Instagram Video Backup to Google Drive\n\nAutomatically backs up Instagram videos (VIDEO and REELS) to Google Drive with searchable JSON metadata catalog.\n\n## Setup Instructions\n\n### 1. Create Google"
      }
    },
    {
      "id": "89183b88-0910-40cd-b666-5b4ae3307130",
      "name": "Upload New Metadata File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        3376,
        240
      ]
    },
    {
      "id": "e3f0c373-5228-4531-9e72-d0eedefdf55f",
      "name": "List All Metadata Files",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3600,
        240
      ]
    },
    {
      "id": "cff11e7f-8989-432e-9a2f-4fa1ba0a3139",
      "name": "Find Old Metadata Files",
      "type": "n8n-nodes-base.code",
      "position": [
        3824,
        240
      ]
    },
    {
      "id": "de67c9e1-5c0e-441e-866d-7a5214432074",
      "name": "Loop Over Old Files",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        4048,
        240
      ]
    },
    {
      "id": "07435d9d-e2e5-4855-a9a0-e459da841cda",
      "name": "Delete Old Metadata File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        4272,
        304
      ]
    },
    {
      "id": "18827ae0-05c3-444b-8220-eecc28317637",
      "name": "End Cleanup Loop",
      "type": "n8n-nodes-base.noOp",
      "position": [
        4272,
        176
      ]
    },
    {
      "id": "826f7257-5442-479e-a023-050a67fe7539",
      "name": "Build Metadata from Data Table",
      "type": "n8n-nodes-base.code",
      "position": [
        3152,
        240
      ]
    },
    {
      "id": "6b72580f-48f3-4bc5-ac86-0319799f8173",
      "name": "Get All Data Table Records",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2928,
        240
      ]
    },
    {
      "id": "038b0927-d467-4bad-8c9f-ceb4466bcb39",
      "name": "End Loop",
      "type": "n8n-nodes-base.noOp",
      "position": [
        4752,
        704
      ]
    },
    {
      "id": "a875008d-2339-478b-a517-a728f1fda30e",
      "name": "Save Backup Record",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        4496,
        560
      ]
    },
    {
      "id": "6787f380-7e93-48f8-b813-126e1c1689aa",
      "name": "Extract Metadata",
      "type": "n8n-nodes-base.set",
      "position": [
        4272,
        560
      ]
    },
    {
      "id": "3d50a9d3-0cf2-486e-8fcd-f325d0698762",
      "name": "Upload to Google Drive",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        4048,
        560
      ]
    },
    {
      "id": "1a1d1d80-9a54-4135-bf71-3118caa7527d",
      "name": "Download Video",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        3824,
        560
      ]
    },
    {
      "id": "efab7150-5f13-4bd4-aa8a-14a7dc32bd2a",
      "name": "Parse Caption",
      "type": "n8n-nodes-base.code",
      "position": [
        3600,
        560
      ]
    },
    {
      "id": "b7ea7693-b851-460c-aac4-2365e3887880",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        3376,
        560
      ]
    },
    {
      "id": "fe280ca2-a8c9-44cf-ac03-cbf3eef364f3",
      "name": "IF Not Already Backed Up",
      "type": "n8n-nodes-base.if",
      "position": [
        3152,
        624
      ]
    },
    {
      "id": "18bb4f99-2744-43ca-9d8e-25e88db383bd",
      "name": "Check If Already Backed Up",
      "type": "n8n-nodes-base.dataTable",
      "position": [
        2928,
        624
      ]
    },
    {
      "id": "7efb911b-b3e3-4672-b980-2d0d38744e8b",
      "name": "Loop Over Videos",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2624,
        624
      ]
    },
    {
      "id": "93c781b7-066d-4147-af35-6c541cd9df33",
      "name": "Filter Videos Only",
      "type": "n8n-nodes-base.if",
      "position": [
        2416,
        640
      ]
    },
    {
      "id": "94dbe269-01c1-4e80-b1d3-075c6b39dd75",
      "name": "Sort Earliest to Latest",
      "type": "n8n-nodes-base.code",
      "position": [
        1968,
        640
      ]
    },
    {
      "id": "bebb7d7f-0259-40e5-af93-1d23623b547f",
      "name": "Split Out Media Items",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        2192,
        640
      ]
    },
    {
      "id": "082f5c57-cdb5-4aff-9621-6811514779d2",
      "name": "Fetch Instagram Media",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1744,
        640
      ]
    },
    {
      "id": "ca45ba9e-41d7-4d4d-990d-1dded3212ce3",
      "name": "Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        1520,
        640
      ]
    },
    {
      "id": "4c2cd070-686f-474d-ab4e-6f2feb31c9b6",
      "name": "Get Instagram Account Info",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1296,
        640
      ]
    },
    {
      "id": "5ad4a85b-dceb-425d-ba06-c1e4dec516e5",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        1072,
        544
      ]
    },
    {
      "id": "a162785e-9490-4394-861e-59ac8b1ca3a1",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        1072,
        736
      ]
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Parse Caption",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "End Loop": {
      "main": [
        [
          {
            "node": "Loop Over Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configuration": {
      "main": [
        [
          {
            "node": "Fetch Instagram Media",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Caption": {
      "main": [
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Video": {
      "main": [
        [
          {
            "node": "Upload to Google Drive",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "Get Instagram Account Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Metadata": {
      "main": [
        [
          {
            "node": "Save Backup Record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Videos": {
      "main": [
        [
          {
            "node": "Get All Data Table Records",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Check If Already Backed Up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Instagram Account Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Videos Only": {
      "main": [
        [
          {
            "node": "Loop Over Videos",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Save Backup Record": {
      "main": [
        [
          {
            "node": "End Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Old Files": {
      "main": [
        [
          {
            "node": "End Cleanup Loop",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Delete Old Metadata File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Instagram Media": {
      "main": [
        [
          {
            "node": "Sort Earliest to Latest",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out Media Items": {
      "main": [
        [
          {
            "node": "Filter Videos Only",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload to Google Drive": {
      "main": [
        [
          {
            "node": "Extract Metadata",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Old Metadata Files": {
      "main": [
        [
          {
            "node": "Loop Over Old Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "List All Metadata Files": {
      "main": [
        [
          {
            "node": "Find Old Metadata Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sort Earliest to Latest": {
      "main": [
        [
          {
            "node": "Split Out Media Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Old Metadata File": {
      "main": [
        [
          {
            "node": "Loop Over Old Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF Not Already Backed Up": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "End Loop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Upload New Metadata File": {
      "main": [
        [
          {
            "node": "List All Metadata Files",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Already Backed Up": {
      "main": [
        [
          {
            "node": "IF Not Already Backed Up",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All Data Table Records": {
      "main": [
        [
          {
            "node": "Build Metadata from Data Table",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Instagram Account Info": {
      "main": [
        [
          {
            "node": "Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Metadata from Data Table": {
      "main": [
        [
          {
            "node": "Upload New Metadata File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}