{
  "name": "Monitor and download changed files from Google Drive automatically",
  "nodes": [
    {
      "id": "96c1dd68-0754-4142-b4a3-33da8c7ecbb4",
      "name": "No Operation",
      "type": "n8n-nodes-base.noOp",
      "position": [
        60,
        -180
      ]
    },
    {
      "id": "1311ef97-df8e-413c-b2a4-744f6d52a464",
      "name": "Merge",
      "type": "n8n-nodes-base.merge",
      "position": [
        280,
        -280
      ]
    },
    {
      "id": "36218a2a-19cb-411b-b16c-abac840c781d",
      "name": "Create Timestamp File",
      "type": "n8n-nodes-base.code",
      "position": [
        1160,
        -280
      ]
    },
    {
      "id": "edc76c05-1f99-4013-b9fe-b13adcac72af",
      "name": "Schedule Trigger1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1480,
        -280
      ]
    },
    {
      "id": "7127ff0e-88c3-4de3-a20d-9691af5cb97e",
      "name": "Search for Timestamp File1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1260,
        -280
      ]
    },
    {
      "id": "1bec1940-0532-4329-9661-fb2bccf00ccd",
      "name": "Download Timestamp File1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -1040,
        -280
      ]
    },
    {
      "id": "93a1e5f1-cfcd-409a-861d-ac2fe26e02fa",
      "name": "Download New Files2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        60,
        -380
      ]
    },
    {
      "id": "97cadaca-a362-401b-9024-f4c982fbdfce",
      "name": "Upload New Timestamp2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        1380,
        -280
      ]
    },
    {
      "id": "1fe60540-aedd-4b20-9ec4-44f63e9c995b",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        -160,
        -280
      ]
    },
    {
      "id": "51894b5f-1a9c-416c-b3ee-49bb20c904f1",
      "name": "Edit Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        500,
        -280
      ]
    },
    {
      "id": "3d6cbf9c-da08-42d4-a682-bf0c97700754",
      "name": "Extract Timestamp Text1",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -820,
        -280
      ]
    },
    {
      "id": "7004e5b2-1d35-4900-ae9a-90e8d4ce2d49",
      "name": "Edit Fields2",
      "type": "n8n-nodes-base.set",
      "position": [
        -600,
        -280
      ]
    },
    {
      "id": "10fae4c7-57ab-44c4-86d1-34ea5fea1316",
      "name": "Search for New Files2",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -380,
        -280
      ]
    },
    {
      "id": "358f5927-e9ce-4935-b9bb-4f34996cb932",
      "name": "Get Current Time1",
      "type": "n8n-nodes-base.dateTime",
      "position": [
        940,
        -280
      ]
    },
    {
      "id": "8f058442-c3e4-47f2-8185-388856bb9338",
      "name": "Delete Old Timestamp File1",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        720,
        -280
      ]
    },
    {
      "id": "47c471f5-e804-42f1-a8b5-d35ec2982daa",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1580,
        -520
      ],
      "parameters": {
        "width": 150,
        "height": 180,
        "content": "Workflow Purpose\nThis workflow automatically downloads new or updated files from a Google Drive folder since the last workflow run, using a timestamp file for tracking."
      }
    },
    {
      "id": "c8aa3c8a-46ab-449a-936c-93955f6f3083",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        -520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "Setup Required\nYou need to set up your Google Drive credentials in n8n for this workflow to function.\nEdit the nodes marked with \"Google Drive\" to select your credentials and set your target folder ID"
      }
    },
    {
      "id": "a5b5c496-231f-44bc-bfb9-7c96b89067cc",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -860,
        -520
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "Timestamp File\nThe workflow looks for a n8n_last_run.txt file in Google Drive to know when it last ran.\nIf the file isn’t found, it defaults to files from the last 24 hours."
      }
    },
    {
      "id": "5c5b741d-2237-4228-afc4-a13eea55faf1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        -600
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "Timestamp Update\nAfter all files are processed, the timestamp file is updated so future runs only process new/changed files."
      }
    }
  ],
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "Download New Files2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Operation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Delete Old Timestamp File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "Search for New Files2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "No Operation": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Current Time1": {
      "main": [
        [
          {
            "node": "Create Timestamp File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger1": {
      "main": [
        [
          {
            "node": "Search for Timestamp File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download New Files2": {
      "main": [
        [
          {
            "node": "Merge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Timestamp File": {
      "main": [
        [
          {
            "node": "Upload New Timestamp2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search for New Files2": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Timestamp Text1": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Timestamp File1": {
      "main": [
        [
          {
            "node": "Extract Timestamp Text1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Delete Old Timestamp File1": {
      "main": [
        [
          {
            "node": "Get Current Time1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search for Timestamp File1": {
      "main": [
        [
          {
            "node": "Download Timestamp File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}