{
  "name": "Sync Shopify customer order data to Airtable with auto-updates",
  "nodes": [
    {
      "id": "3b321191-c893-490a-a46d-269f417c4e72",
      "name": "Code17",
      "type": "n8n-nodes-base.code",
      "position": [
        -2600,
        260
      ]
    },
    {
      "id": "794b3523-183b-44d2-bcee-eac796ec8279",
      "name": "BTSD",
      "type": "n8n-nodes-base.set",
      "position": [
        -1900,
        280
      ]
    },
    {
      "id": "f441b054-7767-4884-82f9-c55187824fc4",
      "name": "Code19",
      "type": "n8n-nodes-base.code",
      "position": [
        -1000,
        280
      ]
    },
    {
      "id": "e46fa249-7b57-41dd-bd48-866d66c69f60",
      "name": "If7",
      "type": "n8n-nodes-base.if",
      "position": [
        -540,
        280
      ]
    },
    {
      "id": "e160ba34-9fb7-43ba-af93-10804109d7bb",
      "name": "Edit Fields15",
      "type": "n8n-nodes-base.set",
      "position": [
        -200,
        580
      ]
    },
    {
      "id": "4e8aa075-9d8e-421f-9083-12c0ae82a0d0",
      "name": "Code20",
      "type": "n8n-nodes-base.code",
      "position": [
        1140,
        600
      ]
    },
    {
      "id": "a564ed1d-9086-4bd3-aa73-d044d1f47e88",
      "name": "Edit Fields16",
      "type": "n8n-nodes-base.set",
      "position": [
        1600,
        600
      ]
    },
    {
      "id": "7ba12eb2-e694-4bcc-87a7-120f111151f1",
      "name": "Code21",
      "type": "n8n-nodes-base.code",
      "position": [
        2040,
        600
      ]
    },
    {
      "id": "b49c2db7-2ca6-47b5-959f-238df3ea171d",
      "name": "Edit Fields18",
      "type": "n8n-nodes-base.set",
      "position": [
        -60,
        -200
      ]
    },
    {
      "id": "2d53e348-ef23-4513-a216-1eb38375d7e6",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -2160,
        260
      ]
    },
    {
      "id": "1be37343-8232-4f5d-bd95-07c52890a771",
      "name": "CCUST",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -1580,
        280
      ]
    },
    {
      "id": "79d22973-b0d6-43eb-9462-b8cd5eaf5e37",
      "name": "CustomerSheet",
      "type": "n8n-nodes-base.airtable",
      "position": [
        420,
        -200
      ]
    },
    {
      "id": "897a477f-9a17-4da2-9003-b45b80ac57cd",
      "name": "CustomerSheet4",
      "type": "n8n-nodes-base.airtable",
      "position": [
        380,
        600
      ]
    },
    {
      "id": "77e1ccce-7e4a-46c2-9a68-3fb688079a6d",
      "name": "PRDSHEET4",
      "type": "n8n-nodes-base.airtable",
      "position": [
        2780,
        600
      ]
    },
    {
      "id": "fefc5e1d-099f-47b3-bdd3-ff8ec5138265",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3340,
        140
      ],
      "parameters": {
        "width": 340,
        "height": 320,
        "content": "## Webhook Trigger when the Customer create order\n"
      }
    },
    {
      "id": "2c9e0430-4150-414f-8b90-33999b8d4dcf",
      "name": "customerCreate",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -3240,
        260
      ]
    },
    {
      "id": "97cdefda-5a75-4891-a07f-c1f57310ac3a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2840,
        -380
      ],
      "parameters": {
        "width": 600,
        "height": 860,
        "content": "# Extracting data from body object\n## customer_id, first_name\n## last_name,  email\n## phone, address\n## address1, address2, city, province\n## zip, country, country_name\n## order_id, order_name\n## firs"
      }
    },
    {
      "id": "40f78983-237f-4e93-a592-f17f4a398923",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1700,
        -40
      ],
      "parameters": {
        "width": 320,
        "height": 500,
        "content": "# Airtable Customer Sheet\n\n## Listing out total rows of customer sheet\n\n"
      }
    },
    {
      "id": "c5888b04-72c9-412d-9443-4ff819429a32",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1280,
        -400
      ],
      "parameters": {
        "width": 680,
        "height": 900,
        "content": "# I'm a note \n## Check if the Customer ID from BTSD (new order/customer) exists in CCUST (customer sheet).\n\n🔄 Steps:\n\nGet Customer ID from BTSD node.\n\nNormalize it: toString(), .trim(), .toLowerCase()"
      }
    },
    {
      "id": "9e84864f-35ff-472e-a3ba-684c6452f670",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        200,
        380
      ],
      "parameters": {
        "width": 440,
        "height": 440,
        "content": "# Airtable Customer Sheet\n\n## Listing out total rows of customer sheet\n\n"
      }
    },
    {
      "id": "2da38eb1-9ed6-424b-9019-499ec498a9d0",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        960,
        100
      ],
      "parameters": {
        "width": 460,
        "height": 760,
        "content": "## Return Only Last Row\nPurpose: Get the last item from all incoming rows and pass it forward.\n\n📌 How it works:\n\n$input.all() → Fetches all incoming items.\n\nrows[rows.length - 1] → Picks the last item"
      }
    },
    {
      "id": "b9a1e8aa-b8e1-4ca6-b423-b42a3f5b31bf",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1820,
        80
      ],
      "parameters": {
        "width": 540,
        "height": 800,
        "content": "# Auto-Increment \"S No\" from Previous Node\n## Take the serial number (S No) from previous node data, increment it by 1, and return the updated data.\n\n📌 How it works:\n\nReads the first item from the inp"
      }
    },
    {
      "id": "adbb346f-1172-4834-bb89-3e07b13798ec",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2640,
        380
      ],
      "parameters": {
        "width": 460,
        "height": 500,
        "content": "# Airtable Sheet\n## Appending data in Airtable of new Customer Sheet "
      }
    },
    {
      "id": "d9ecb297-0e3e-47d5-a837-0fb8073b8fb6",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        -500
      ],
      "parameters": {
        "width": 480,
        "height": 560,
        "content": "# Airtable Customer Sheet\n## Updating the existing Customer Record in customer sheet like if he/she has changed the personal details like Address, Email Address, Contact number. "
      }
    },
    {
      "id": "fb8ea402-0810-4295-81ff-eb58c612ee5c",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -4640,
        -940
      ],
      "parameters": {
        "width": 980,
        "height": 1740,
        "content": "## This automation is built in n8n (a no-code/low-code automation platform). It automatically updates or adds customer data into your system every time a customer places an order on your Shopify store"
      }
    }
  ],
  "connections": {
    "If7": {
      "main": [
        [
          {
            "node": "Edit Fields18",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Edit Fields15",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "BTSD": {
      "main": [
        [
          {
            "node": "CCUST",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CCUST": {
      "main": [
        [
          {
            "node": "Code19",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code17": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code19": {
      "main": [
        [
          {
            "node": "If7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code20": {
      "main": [
        [
          {
            "node": "Edit Fields16",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code21": {
      "main": [
        [
          {
            "node": "PRDSHEET4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "PRDSHEET4": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CustomerSheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields15": {
      "main": [
        [
          {
            "node": "CustomerSheet4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields16": {
      "main": [
        [
          {
            "node": "Code21",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields18": {
      "main": [
        [
          {
            "node": "CustomerSheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "CustomerSheet4": {
      "main": [
        [
          {
            "node": "Code20",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "customerCreate": {
      "main": [
        [
          {
            "node": "Code17",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "BTSD",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}