{
  "id": "JWDeOEU4U1dqg0Vb",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Daily Price Tracking with Bright Data in n8n + Smart Alerts on Price Drops",
  "tags": [],
  "nodes": [
    {
      "id": "11da53a7-4296-4e62-b8b6-fc527925be20",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -40,
        60
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 9
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "ad294df7-f1d6-4e32-920c-745b854adec9",
      "name": "Format Price Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1180,
        60
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ab93ebd8-c88e-4fd9-8b0b-cd77f0a427f6",
              "name": "old_price",
              "type": "string",
              "value": "={{ $('Read Google Shopping URLs').item.json['New Price'] }}"
            },
            {
              "id": "be7bb08c-c9ca-44df-97ff-9cde478e62b8",
              "name": "new_price",
              "type": "string",
              "value": "={{ $json['New Price'] }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "5ac9d43d-71e5-4b7c-ac11-c349d7eabaa7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        460,
        -100
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "#### Extract Product Data \nThis step scrapes detailed product information (e.g., name, ID, price, review count, ratings) from the provided Google Shopping URLs using BrightData."
      },
      "typeVersion": 1
    },
    {
      "id": "bd3c2cf7-a7a1-4e7c-a3d8-52a76724e528",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        -100
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "#### Input Product URLs  \nThis step reads Google Shopping product URLs from a Google Sheet. These URLs are the sources for extracting product data using BrightData."
      },
      "typeVersion": 1
    },
    {
      "id": "0c69407f-5272-4398-bd91-7b388ef5fd43",
      "name": "Read Google Shopping URLs",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        220,
        60
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/",
          "cachedResultName": "Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6,
      "alwaysOutputData": true
    },
    {
      "id": "1f4beb71-26ff-4136-baef-7bbc32f79eb4",
      "name": "Extract Product Info (BrightData)",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "position": [
        560,
        60
      ],
      "parameters": {
        "urls": "=[{\"url\":\"{{ $json['Product URL'] }}\"}]",
        "resource": "webScrapper",
        "dataset_id": {
          "__rl": true,
          "mode": "list",
          "value": "gd_ltppk50q18kdw67omz",
          "cachedResultName": "Google Shopping"
        },
        "include_errors": true,
        "requestOptions": {}
      },
      "credentials": {
        "brightdataApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "57d80688-0309-4791-914f-f3e50a172e82",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        800,
        -100
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "#### Update Prices in Google Sheet\nThis step updates the Google Sheet with the latest product prices scraped from Google Shopping. It enables easy comparison with previously stored prices.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "c4a28312-eacf-43a9-abf4-be4ee8b5cd5f",
      "name": "Update Sheet with New Prices",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        900,
        60
      ],
      "parameters": {
        "columns": {
          "value": {
            "Ratings": "={{ $json.rating }}",
            "Reviews": "={{ $json.reviews_count }}",
            "New Price": "={{ $json.item_price }}",
            "Product URL": "={{ $json.url }}",
            "Product name": "={{ $json.title }}"
          },
          "schema": [
            {
              "id": "Product URL",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Product URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Product name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Product name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Old Price",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Old Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Total Price",
              "type": "string",
              "display": true,
              "removed": true,
              "required": false,
              "displayName": "Total Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Ratings",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Ratings",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Reviews",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Reviews",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "New Price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "New Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": true,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Product URL"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "update",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1Niak14QnnwMPNcX8PRoqBIpciHD78dS0t35stVvT_aA/edit#gid=0",
          "cachedResultName": "Data"
        },
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "https://docs.google.com/spreadsheets/d/1Niak14QnnwMPNcX8PRoqBIpciHD78dS0t35stVvT_aA/edit?gid=0#gid=0"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "f44ac341-0377-4f44-b234-6a02b8852d6a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        -100
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "#### Check for Price Drop\nThis step compares the newly scraped price with the previously stored price in the sheet. It filters the data to pass through only if the new price is lower than the old price.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2c722696-0b3e-4ae2-bed2-0b003f074e8e",
      "name": "Filter Price Drop",
      "type": "n8n-nodes-base.filter",
      "position": [
        1460,
        60
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "6e2e7834-0fa0-4ccf-a45a-5c21e9d366c0",
              "operator": {
                "type": "number",
                "operation": "equals"
              },
              "leftValue": "={{ parseFloat($json.new_price.replace(/[$,]/g, '')) }}",
              "rightValue": "={{ parseFloat($json.old_price.replace(/[$,]/g, '')) }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "83cf809a-4e07-43a0-95b3-306f3ae59845",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1720,
        -100
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "#### Loop Through Dropped Prices\nThis step iterates over each product that had a price drop. It enables the workflow to handle each item individually\u2014checking and processing them one by one.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2cc4ff30-914c-45b2-b7ed-0c4120bcf6c3",
      "name": "Loop Over Price Drop Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        1820,
        60
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "d7265c9e-1c11-445d-add4-be7004dc5ebc",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2060,
        -100
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "#### Send Notification Email\nThis step sends an email alert for products whose prices have dropped. The email typically includes product details like name, old price, new price, and possibly the product URL.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "79b755b1-73f2-41d2-b4cd-29ae14b1257d",
      "name": "Notify Price Drop via Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2160,
        60
      ],
      "parameters": {
        "sendTo": "user@example.com",
        "message": "=Hey,\n\nYou are missing the opportunity to buy the product on the bottom line.\nProduct URL: {{ $('Update Sheet with New Prices').item.json['Product URL'] }}",
        "options": {},
        "subject": "Hurry UP Price is Gonna Up",
        "emailType": "text"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "fa53cc05-25e5-4a95-8f0c-e3e29377b761",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2400,
        -100
      ],
      "parameters": {
        "width": 300,
        "height": 340,
        "content": "#### Wait Before Next Iteration\nThis step introduces a wait/pause after sending each email to prevent spam or hitting rate limits\u2014especially useful when dealing with many notifications.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "ba9a1a50-38cb-41b3-afd8-b3141416574c",
      "name": "5 Minute Pause Between Emails",
      "type": "n8n-nodes-base.wait",
      "position": [
        2520,
        60
      ],
      "parameters": {
        "unit": "minutes"
      },
      "typeVersion": 1.1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "04d650c5-0431-41de-8fcb-06fdb078fcb0",
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Read Google Shopping URLs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Price Drop": {
      "main": [
        [
          {
            "node": "Loop Over Price Drop Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Price Data": {
      "main": [
        [
          {
            "node": "Filter Price Drop",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Google Shopping URLs": {
      "main": [
        [
          {
            "node": "Extract Product Info (BrightData)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Price Drop Items": {
      "main": [
        [],
        [
          {
            "node": "Notify Price Drop via Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Notify Price Drop via Email": {
      "main": [
        [
          {
            "node": "5 Minute Pause Between Emails",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Sheet with New Prices": {
      "main": [
        [
          {
            "node": "Format Price Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5 Minute Pause Between Emails": {
      "main": [
        [
          {
            "node": "Loop Over Price Drop Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Product Info (BrightData)": {
      "main": [
        [
          {
            "node": "Update Sheet with New Prices",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}