{
  "meta": {
    "templateId": "2071"
  },
  "nodes": [
    {
      "id": "577fb3b7-b0a6-4f2b-9b53-36d1f77de5a0",
      "name": "Get File ID",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1120,
        1120
      ],
      "parameters": {
        "id": "={{ $node[\"New Upload\"].json[\"id\"] }}",
        "base": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Base ID\"] }}"
        },
        "table": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Upload Table ID\"] }}"
        },
        "options": {},
        "operation": "get"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "a287658f-50e0-4d08-9342-a5143dc20ff2",
      "name": "Status Failed",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2820,
        1180
      ],
      "parameters": {
        "url": "=https://api.airtable.com/v0/{{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Base ID\"] }}/{{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Upload Table ID\"] }}",
        "method": "PATCH",
        "options": {},
        "jsonBody": "={\n\"records\":[{\n\"id\":\"{{ $item(\"0\").$node[\"Get File ID\"].json[\"record_id\"] }}\",\n\"fields\":{\n\"Status\":\"Failed\"\n}\n}\n]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "airtableTokenApi"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.1
    },
    {
      "id": "e3aae523-4803-4f69-9697-ab677c3f216d",
      "name": "Status Uploaded",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2820,
        1020
      ],
      "parameters": {
        "url": "=https://api.airtable.com/v0/{{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Base ID\"] }}/{{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Upload Table ID\"] }}",
        "method": "PATCH",
        "options": {},
        "jsonBody": "={\n\"records\":[{\n\"id\":\"{{ $item(\"0\").$node[\"Get File ID\"].json[\"record_id\"] }}\",\n\"fields\":{\n\"Status\":\"Uploaded\"\n}\n}\n]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "airtableTokenApi"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "executeOnce": true,
      "typeVersion": 4.1
    },
    {
      "id": "833515af-bf3a-4bc7-b79c-a6c1731f4714",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2280,
        820
      ],
      "parameters": {
        "width": 319.2310328152142,
        "height": 538.9310265075466,
        "content": "## \ud0a4 \uc774\ub984\uacfc \uc5f4 \ucc38\uc870 \ud655\uc778\n\n\uc774\ub97c \uadc0\ud558\uc758 \uae30\ubcf8 \ubc0f Google Sheets (CSV) \ud15c\ud50c\ub9bf\uc5d0 \uc801\uc6a9\ud560 \ub54c, \uc774 \ub178\ub4dc\ub97c \uadf8\uc5d0 \ub530\ub77c \uc218\uc815\ud558\uc2ed\uc2dc\uc624. \ud0a4 \uac12\uc744 Airtable \ud544\ub4dc\uc5d0 \uc124\uc815\ud574\uc57c \ud558\uba70, Expressions\uac00 Read File \uc5f4 \uc774\ub984\uacfc \uc77c\uce58\ud574\uc57c \ud569\ub2c8\ub2e4.\n\n\ud544\ub4dc\uac00 \uc62c\ubc14\ub978 \ub370\uc774\ud130 \uc720\ud615(\ubb38\uc790\uc5f4, \uc815\uc218(\uc22b\uc790) \ub4f1)\uc744 \uac00\uc9c0\uace0 \uc788\ub294\uc9c0 \ud655\uc778\ud558\uc2ed\uc2dc\uc624."
      },
      "typeVersion": 1
    },
    {
      "id": "e3cfcf21-3210-455c-b539-2dcacda3172a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        840,
        920
      ],
      "parameters": {
        "height": 416.06551185206945,
        "content": "Airtable\uc758 \uad00\ub828 ID\ub97c \uc785\ub825\ud558\uc138\uc694. \uc774\ub294 API \ud638\ucd9c\uc5d0 \uc0ac\uc6a9\ub420 \uac83\uc785\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "c244d6fe-21bf-4488-9780-32b56baa9998",
      "name": "Campaign is Not Empty",
      "type": "n8n-nodes-base.if",
      "position": [
        1880,
        1120
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $item(\"0\").$node[\"Get File ID\"].json[\"Campaign\"][\"0\"] }}",
              "operation": "isNotEmpty"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ced8a7f4-4ccc-4fcf-8c13-c1b8f099283e",
      "name": "Campaign Not Empty",
      "type": "n8n-nodes-base.set",
      "position": [
        2120,
        1020
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "Campaign",
              "stringValue": "=\"Campaigns\":[\"{{ $item(\"0\").$node[\"Get File ID\"].json[\"Campaign\"][\"0\"] }}\"],"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "23e0a41c-cbbd-401d-88b4-a4b190dbcd72",
      "name": "Campaign Not Empty1",
      "type": "n8n-nodes-base.set",
      "position": [
        2120,
        1200
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "Campaign"
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "f6c40cf2-4893-42ee-859c-f430b4dc5cf1",
      "name": "Read File",
      "type": "n8n-nodes-base.spreadsheetFile",
      "position": [
        1660,
        1120
      ],
      "parameters": {
        "options": {
          "headerRow": true
        },
        "binaryPropertyName": "=data"
      },
      "typeVersion": 2
    },
    {
      "id": "b7495a65-32bf-430d-9998-483582bbe6ef",
      "name": "Airtable Base IDs",
      "type": "n8n-nodes-base.set",
      "position": [
        900,
        1120
      ],
      "parameters": {
        "fields": {
          "values": [
            {
              "name": "Base ID",
              "stringValue": "=appZ0qelhmC2Y9igI"
            },
            {
              "name": "Upload Table ID",
              "stringValue": "tblDzSabZcP47sIMp"
            },
            {
              "name": "Lead Table ID",
              "stringValue": "tblnsXKf3TBztlIPV"
            }
          ]
        },
        "include": "none",
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "9fa8f822-f611-4af6-a2a4-7baaf2efa82d",
      "name": "Status Processing",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1280,
        1120
      ],
      "parameters": {
        "url": "=https://api.airtable.com/v0/{{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Base ID\"] }}/{{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Upload Table ID\"] }}",
        "method": "PATCH",
        "options": {},
        "jsonBody": "={\n\"records\":[{\n\"id\":\"{{ $node[\"Get File ID\"].json[\"record_id\"] }}\",\n\"fields\":{\n\"Status\":\"Processing\"\n}\n}\n]\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "airtableTokenApi"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "af23a338-a9a0-49db-88de-d6eb68af2be9",
      "name": "Download File",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1460,
        1120
      ],
      "parameters": {
        "url": "={{ $node[\"Get File ID\"].json[\"File\"][\"0\"][\"url\"] }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "4428cdc4-1ffd-4f6f-8d96-49d20b80bfba",
      "name": "Create Records",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueErrorOutput",
      "position": [
        2380,
        1120
      ],
      "parameters": {
        "url": "=https://api.airtable.com/v0/{{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Base ID\"] }}/{{ $item(\"0\").$node[\"Airtable Base IDs\"].json[\"Lead Table ID\"] }}",
        "method": "POST",
        "options": {
          "batching": {
            "batch": {
              "batchSize": 8
            }
          }
        },
        "jsonBody": "={\n    \"records\": [\n        {\n            \"fields\": {\n                \"FirstName\": \"{{ $json[\"FirstName\"] }}\",\n                \"LastName\": \"{{ $json[\"LastName\"] || \"\"}}\",\n                \"Email\": \"{{ $json[\"Email\"] || \"\" }}\",\n                \"Phone\": \"{{ $json[\"Phone\"] || \"\" }}\",\n                \"Company\": \"{{ $json[\"Company\"] || \"\" }}\",\n                \"Title\": \"{{ $json[\"Title\"] || \"\" }}\",\n                \"Country\": \"{{ $json[\"Country\"] || \"\" }}\",\n                \"City\": \"{{ $json[\"City\"] || \"\" }}\",\n                \"Website\": \"{{ $json[\"Website\"] || \"\" }}\",\n                \"LeadSource\": \"{{ $json[\"LeadSource\"] || \"\" }}\",\n                \"LeadStatus\": \"{{ $json[\"LeadStatus\"] || \"\" }}\",\n                {{ $json[\"Campaign\"] }}\n                \"InterestLevel\": \"{{ $json[\"InterestLevel\"] || \"\" }}\",\n                \"LastContactDate\": \"{{ $json[\"LastContactDate\"] || \"\" }}\"\n\n\n            }\n        }\n    ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "nodeCredentialType": "airtableTokenApi"
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.1
    },
    {
      "id": "e7a2cf60-099f-4c32-b9f0-ad2dd3d6e282",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        380,
        240
      ],
      "parameters": {
        "width": 1608.819505196552,
        "height": 349.25800232621134,
        "content": "# CSV\ub97c \ud1b5\ud574 \uc5f0\ub77d\ucc98 \uc77c\uad04 \uc5c5\ub85c\ub4dc | Airtable Interface & Airtable Grid\n\n## Airtable \ud15c\ud50c\ub9bf - https://www.airtable.com/universe/expkxniTpHDg4Y4Ni/interfaces-upload-bulk-records-from-csv\n\n## Google Sheets \ud15c\ud50c\ub9bf - https://docs.google.com/spreadsheets/d/1SEwOGCfekc1h_ZfZ8PDQY6oGgOGSzSgtD7pEliEGaZ0/edit?usp=sharing"
      },
      "typeVersion": 1
    },
    {
      "id": "dd8b54fa-15fb-4df5-b94f-8286dae7026b",
      "name": "New Upload",
      "type": "n8n-nodes-base.airtableTrigger",
      "position": [
        660,
        1120
      ],
      "parameters": {
        "baseId": {
          "__rl": true,
          "mode": "id",
          "value": "appZ0qelhmC2Y9igI"
        },
        "tableId": {
          "__rl": true,
          "mode": "id",
          "value": "tblDzSabZcP47sIMp"
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerField": "Created At",
        "authentication": "airtableTokenApi",
        "additionalFields": {
          "viewId": ""
        }
      },
      "credentials": {
        "airtableTokenApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "32f6ec9b-3f23-4d58-9cc2-b41fd9246091",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1980,
        240
      ],
      "parameters": {
        "width": 879.3031720944707,
        "height": 224.90387533954015,
        "content": "## \uc6cc\ud06c\uc2a4\ub8e8 \ubc0f \uac1c\uc694\n\n### https://www.youtube.com/watch?v=LgYxS1O-rbs"
      },
      "typeVersion": 1
    },
    {
      "id": "78363718-c1c2-4bf0-ba04-a48403cca0cb",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        60,
        820
      ],
      "parameters": {
        "width": 558.4226026659302,
        "height": 768.2443727570767,
        "content": "# \uc124\uc815 \uccb4\ud06c\ub9ac\uc2a4\ud2b8\n\n### 1. Airtable \ud15c\ud50c\ub9bf\uc73c\ub85c \uc774\ub3d9\ud558\uc5ec \ucd5c\uc2e0 \ubc84\uc804\uc758 \ubca0\uc774\uc2a4\ub97c \ubcf5\uc0ac\ud558\uc138\uc694\n### \n### 2. \uc0c8 Airtable \ubca0\uc774\uc2a4 URL\uc5d0\uc11c \ubca0\uc774\uc2a4\uc640 \ud14c\uc774\ube14 ID\ub97c \uac00\uc838\uc640 \uc774 \uc6cc\ud06c\ud50c\ub85c\uc758 \ud2b8\ub9ac\uac70 \ub178\ub4dc\uc5d0 \ub300\uccb4\ud558\uc138\uc694\n### 3. Airtable ID\ub97c \ub450 \ubc88\uc9f8 \ub178\ub4dc \"Airtable Base ID's\"\uc5d0 \uc785\ub825\ud558\uc138\uc694\n### 4. Airtable \ud1b5\ud569\uc744 \uc704\ud55c \uac1c\uc778 \uc561\uc138\uc2a4 \ud1a0\ud070\uc744 \ucd94\uac00\ud558\uc138\uc694. \ucd5c\uc18c\ud55c \"data.record:read\", \"data.record:write\", \"schema.bases:read\" \uc2a4\ucf54\ud504\uac00 \ud65c\uc131\ud654\ub418\uc5b4 \uc788\uc5b4\uc57c \ud569\ub2c8\ub2e4\n### 5. \uc774\uc81c \uc778\ud130\ud398\uc774\uc2a4 \ud3fc\uc5d0\uc11c \ud30c\uc77c \uc5c5\ub85c\ub4dc\ub97c \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4\n\n# \uc124\uc815 \ud6c4\n\n### - \ud544\ub4dc\ub97c \ucd94\uac00, \uc81c\uac70 \ub610\ub294 \uc218\uc815(\ub610\ub294 \ud544\ub4dc \uc774\ub984 \uc218\uc815)\ud55c \uacbd\uc6b0, \ud574\ub2f9 \ubcc0\uacbd \uc0ac\ud56d\uc744 \"Create Record\" \ub178\ub4dc\uc5d0\ub3c4 \uc801\uc6a9\ud588\ub294\uc9c0 \ud655\uc778\ud558\uc138\uc694\n### - CSV \uc5c5\ub85c\ub4dc \ud5e4\ub354 \ud589\uc774 Airtable Leads \ud544\ub4dc \uc774\ub984\uacfc \uc77c\uce58\ud558\ub294\uc9c0 \ud655\uc778\ud558\uc138\uc694\n### - \ud544\ub4dc \uc720\ud615\uc744 \uc218\uc815\ud55c \uacbd\uc6b0(\ud14d\uc2a4\ud2b8\uc5d0\uc11c \uc22b\uc790\ub85c, \ub610\ub294 \uc22b\uc790\uc5d0\uc11c \ud14d\uc2a4\ud2b8\ub85c), \"Create Records\" \uac12\uc5d0\ub3c4 \uc801\uc6a9\ud558\uc138\uc694(\uc22b\uc790\ub294 \uc30d\ub530\uc634\ud45c \uc5c6\uc774 / \ubb38\uc790\uc5f4, \ub0a0\uc9dc \ubc0f \uae30\ud0c0 \ub370\uc774\ud130 \uc720\ud615\uc740 \uc30d\ub530\uc634\ud45c\ub85c) [JSON \uad6c\ubb38]"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Read File": {
      "main": [
        [
          {
            "node": "Campaign is Not Empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New Upload": {
      "main": [
        [
          {
            "node": "Airtable Base IDs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File ID": {
      "main": [
        [
          {
            "node": "Status Processing",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download File": {
      "main": [
        [
          {
            "node": "Read File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Records": {
      "main": [
        [
          {
            "node": "Status Uploaded",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Status Failed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Airtable Base IDs": {
      "main": [
        [
          {
            "node": "Get File ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Status Processing": {
      "main": [
        [
          {
            "node": "Download File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Campaign Not Empty": {
      "main": [
        [
          {
            "node": "Create Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Campaign Not Empty1": {
      "main": [
        [
          {
            "node": "Create Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Campaign is Not Empty": {
      "main": [
        [
          {
            "node": "Campaign Not Empty",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Campaign Not Empty1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}