{
  "nodes": [
    {
      "parameters": {
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "event": "newRow",
        "tableName": "Documents",
        "viewName": "Document available",
        "options": {
          "simple": false
        }
      },
      "type": "n8n-nodes-base.seaTableTrigger",
      "typeVersion": 2,
      "position": [
        -2688,
        -1072
      ],
      "id": "9b0254d4-45e4-4a58-9168-b00773085a40",
      "name": "SeaTable Trigger: new file",
      "credentials": {
        "seaTableApi": {
          "id": "REPLACE_ME",
          "name": "SeaTable account"
        }
      }
    },
    {
      "parameters": {
        "resource": "asset",
        "operation": "getPublicURL",
        "assetPath": "={{ $json.File[0].path }}"
      },
      "type": "n8n-nodes-base.seaTable",
      "typeVersion": 2,
      "position": [
        -2528,
        -1072
      ],
      "id": "4e2f7a59-f9c6-4661-97f1-5cc66a11eb3c",
      "name": "1. Get public URL",
      "credentials": {
        "seaTableApi": {
          "id": "REPLACE_ME",
          "name": "SeaTable account"
        }
      }
    },
    {
      "parameters": {
        "url": "={{ $json.download_link }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        -2368,
        -1072
      ],
      "id": "63b4e968-62fe-462c-9636-135c46ecb6f1",
      "name": "2. HTTP Request: download"
    },
    {
      "parameters": {
        "name": "={{ $('SeaTable Trigger: new file').item.json.File[0].name }}",
        "driveId": {
          "__rl": true,
          "mode": "list",
          "value": "My Drive"
        },
        "folderId": {
          "__rl": true,
          "value": "REPLACE_WITH_YOUR_FOLDER_ID",
          "mode": "list",
          "cachedResultName": "Select your archive folder"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.googleDrive",
      "typeVersion": 3,
      "position": [
        -2208,
        -1072
      ],
      "id": "69352a95-98a5-4eab-a8ea-411670c09738",
      "name": "3. Upload file",
      "credentials": {
        "googleDriveOAuth2Api": {
          "id": "REPLACE_ME",
          "name": "Google Drive account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "tableName": "Documents",
        "rowId": "={{ $('SeaTable Trigger: new file').item.json._id }}",
        "columnsUi": {
          "columnValues": [
            {
              "columnName": "Backup URL",
              "columnValue": "={{ $json.webViewLink }}"
            }
          ]
        }
      },
      "type": "n8n-nodes-base.seaTable",
      "typeVersion": 2,
      "position": [
        -2048,
        -1072
      ],
      "id": "c324d76d-683f-4496-bc47-e6995e79f2bf",
      "name": "4. Write back Drive link",
      "credentials": {
        "seaTableApi": {
          "id": "REPLACE_ME",
          "name": "SeaTable account"
        }
      }
    }
  ],
  "connections": {
    "SeaTable Trigger: new file": {
      "main": [
        [
          {
            "node": "1. Get public URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Get public URL": {
      "main": [
        [
          {
            "node": "2. HTTP Request: download",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. HTTP Request: download": {
      "main": [
        [
          {
            "node": "3. Upload file",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3. Upload file": {
      "main": [
        [
          {
            "node": "4. Write back Drive link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {}
}
