{
  "id": "uI42CkjSqzFh4n78",
  "name": "Spotting Competitor Pricing & Product Gaps with Bright Data & n8n",
  "tags": [],
  "nodes": [
    {
      "id": "02df4534-3459-49b8-93b6-91c7e3350406",
      "name": "Run Competitive Analysis",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -2944,
        816
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "d56b0641-1f9f-43b3-801f-a51d26e3abf0",
      "name": "Set Target URL",
      "type": "n8n-nodes-base.set",
      "position": [
        -2768,
        816
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ab69b180-2b34-449e-b23a-00631bb57a66",
              "name": "URL",
              "type": "string",
              "value": "https://www.amazon.com/Amazon-Basics-Micro-Foam-Nitrile-Coated/dp/B08DDZ1BDV/ref=sr_1_1?adgrpid=87137420328&dib=eyJ2IjoiMSJ9.TSfdhc3EZnn9H2llyVoZXzn6Mt0g1fqCSJpTXab0SD8x6YU9WZ2p72KbpJyDfwxxh5BNCBzULjb_5y7zhoLRB_iVL8czclcKAA_7_xmKkXZ9gYpoNd2lwRSz0oagsf-VvAbQC1hlVJkMdhO9MmnLoKYXpB5A-OEOcAy7cWej-XGIQJaBZR49M28Z1zntbeitNxrDMQ4YGQ5rOKAS1XzrFBuX1C4SRQzU1ePB2ypceERh4jNmti_ZVbQaOv-EyHkYpJS2PgXMjhAfkiXEB9ZC_9qIi5J4YqlgRmMrZKVGvBg.ZMnwoBOKQaX36cEuy0iI6R6v_WszSLdW_zsQjRePkqg&dib_tag=se&hvadid=585479824073&hvdev=c&hvlocphy=9075163&hvnetw=g&hvqmt=b&hvrand=1405474185371293561&hvtargid=kwd-2971+1234567890&hydadcr=29108_14573980&keywords=gloves+amazon&mcid=b731b334a709335cb77408996e3e4244&qid=1771246359&sr=8-1"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "14d88ac3-be22-4103-af6e-422932578d5c",
      "name": "Scrape Product Data (Bright Data)",
      "type": "@brightdata/n8n-nodes-brightdata.brightData",
      "onError": "continueErrorOutput",
      "position": [
        -2224,
        816
      ],
      "parameters": {
        "urls": "=[\n  {\n    \"url\": \"{{ $json.URL }}\"\n  }\n]\n",
        "resource": "webScrapper",
        "dataset_id": {
          "__rl": true,
          "mode": "list",
          "value": "gd_l7q7dkf244hwjntr0",
          "cachedResultName": "Amazon products"
        },
        "requestOptions": {}
      },
      "notesInFlow": false,
      "retryOnFail": true,
      "typeVersion": 1,
      "waitBetweenTries": 5000
    },
    {
      "id": "380a8b13-7ffe-4091-9f4b-c6093f1601fe",
      "name": "Normalize & Structure Product Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -1904,
        800
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n  const data = item.json;\n\n  let categoryOutput = null;\n\n  if (Array.isArray(data.categories)) {\n    categoryOutput = data.categories;   // return as array\n  } else if (typeof data.categories === \"string\") {\n    categoryOutput = data.categories;   // return as string\n  }\n\n  return {\n    category: categoryOutput,\n    competitor: data.brand || null,\n    productName: data.title || null,\n\n    price: data.buybox_price ||\n           data.final_price ||\n           data.initial_price ||\n           null,\n\n    variants: data.variations\n      ? data.variations.map(v => ({\n          name: v.name || null,\n          asin: v.asin || null,\n          price: v.price || null,\n          currency: v.currency || null\n        }))\n      : null,\n\n    availability: data.availability || null\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "7e387638-4927-43d0-b7ff-8eec78786cd5",
      "name": "AI Competitive Gap Analyzer",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -1232,
        800
      ],
      "parameters": {
        "text": "=Cluster this ecommerce product by similarity and detect gaps.\n\nProduct:\n{{$json.productName}}\n\nCompetitor:\n{{$json.competitor}}\n\nCategory:\n{{$json.category}}\n\nVariants:\n{{$json.variants}}\n\nRespond ONLY in strict JSON format with this structure:\n\n{\n  \"productName\": \"\",\n  \"competitor\": \"\",\n  \"cluster\": \"\",\n  \"missingVariants\": [],\n  \"bundleOpportunity\": \"\",\n  \"positioningGap\": \"\"\n}\n",
        "options": {
          "systemMessage": "You are an ecommerce merchandising intelligence engine.\nAlways respond in strict JSON.\nDo not explain anything.\n"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "5d4e60f3-9dab-460d-a140-b2838ad96fa8",
      "name": "Validate AI Structured Output",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1072,
        1056
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"productName\": {\n      \"type\": \"string\"\n    },\n    \"competitor\": {\n      \"type\": \"string\"\n    },\n    \"cluster\": {\n      \"type\": \"string\"\n    },\n    \"missingVariants\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      }\n    },\n    \"bundleOpportunity\": {\n      \"type\": \"string\"\n    },\n    \"positioningGap\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"productName\",\n    \"competitor\",\n    \"cluster\",\n    \"missingVariants\",\n    \"bundleOpportunity\",\n    \"positioningGap\"\n  ],\n  \"additionalProperties\": false\n}\n"
      },
      "typeVersion": 1.3
    },
    {
      "id": "c3e520ff-f0f0-491c-a429-f36e433038fb",
      "name": "Score Pricing & Assortment Gap",
      "type": "n8n-nodes-base.code",
      "position": [
        -896,
        800
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n\n  const data = item.json.output; // \u2705 correct path\n  let score = 0;\n\n  // Positioning gap scoring\n  if (data.positioningGap) {\n    const gapText = data.positioningGap.toLowerCase();\n\n    if (\n      gapText.includes(\"premium\") ||\n      gapText.includes(\"high\") ||\n      gapText.includes(\"extreme\")\n    ) {\n      score += 40;\n    } else if (gapText.length > 0) {\n      score += 25;\n    }\n  }\n\n  // Missing variants scoring\n  if (Array.isArray(data.missingVariants) && data.missingVariants.length > 0) {\n    score += 30;\n  }\n\n  // Bundle opportunity scoring\n  if (data.bundleOpportunity && data.bundleOpportunity.length > 0) {\n    score += 30;\n  }\n\n  return {\n    json: {\n      ...data,\n      pricingGapScore: score\n    }\n  };\n});\n"
      },
      "typeVersion": 2
    },
    {
      "id": "e6fcffb8-09da-4154-b7fc-93e50061af9f",
      "name": "Is High-Priority Opportunity?",
      "type": "n8n-nodes-base.if",
      "position": [
        -256,
        800
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "32400f89-a9b7-4fab-88a7-fef25b7f816c",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.pricingGapScore }}",
              "rightValue": 50
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "a1aa432b-1c3a-4234-b37f-4b632359e2f2",
      "name": "Format High-Priority Record",
      "type": "n8n-nodes-base.set",
      "position": [
        672,
        784
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "3f0c609b-9c71-4576-9e78-a25bb386fcf6",
              "name": "productName",
              "type": "string",
              "value": "={{ $json.productName }}"
            },
            {
              "id": "ca7ff412-8475-4a02-81cb-afc5e817cbc0",
              "name": "competitor",
              "type": "string",
              "value": "={{ $json.competitor }}"
            },
            {
              "id": "37aaa730-a3a1-4772-815c-6fd4848b7498",
              "name": "cluster",
              "type": "string",
              "value": "={{ $json.cluster }}"
            },
            {
              "id": "0746b274-3fde-4897-8921-c7817b1e0d25",
              "name": "missingVariants",
              "type": "array",
              "value": "={{ $json.missingVariants }}"
            },
            {
              "id": "979b164f-79d6-44d0-a6ce-a4e88b9b09b9",
              "name": "bundleOpportunity",
              "type": "string",
              "value": "={{ $json.bundleOpportunity }}"
            },
            {
              "id": "d9683bd2-75c2-4478-9de4-fbb91de4b12e",
              "name": "positioningGap",
              "type": "string",
              "value": "={{ $json.positioningGap }}"
            },
            {
              "id": "8b968d7b-97e8-4690-b416-bb722b5c067d",
              "name": "pricingGapScore",
              "type": "number",
              "value": "={{ $json.pricingGapScore }}"
            },
            {
              "id": "70d16c22-d746-492d-a37f-c3df86a1da46",
              "name": "Priority",
              "type": "string",
              "value": "High"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2d70c0a7-5e1b-4036-a6bb-b852832f1d7a",
      "name": "Log Missing Variants",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        960,
        576
      ],
      "parameters": {
        "columns": {
          "value": {
            "Product": "={{ $json.productName }}",
            "Category": "={{ $('Normalize & Structure Product Data').item.json.category }}",
            "Priority": "={{ $json.Priority }}",
            "Competitor": "={{ $json.competitor }}",
            "Missing Variants": "={{ $json.missingVariants }}"
          },
          "schema": [
            {
              "id": "Category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Competitor",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Competitor",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Product",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Product",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Missing Variants",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Missing Variants",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Priority",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Priority",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WUZASFK2ztAbOEa-cIe_s_Rjc3nacFd82YbTs4OswmI/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y/edit?usp=drivesdk",
          "cachedResultName": "4. Bright Data Competitive Assortment & Pricing Gap Intelligence Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "76401285-16bb-4094-a736-37241d42666d",
      "name": "Log Bundle Opportunities",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        960,
        784
      ],
      "parameters": {
        "columns": {
          "value": {
            "product": "={{ $json.productName }}",
            "category": "={{ $('Normalize & Structure Product Data').item.json.category }}",
            "priority": "={{ $json.Priority }}",
            "bundleOpportunity": "={{ $json.bundleOpportunity }}",
            "recommendedVariants": "={{ $json.missingVariants }}"
          },
          "schema": [
            {
              "id": "category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "product",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "recommendedVariants",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "recommendedVariants",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "bundleOpportunity",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "bundleOpportunity",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "priority",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "priority",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 868610377,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WUZASFK2ztAbOEa-cIe_s_Rjc3nacFd82YbTs4OswmI/edit#gid=868610377",
          "cachedResultName": "Sheet2"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y/edit?usp=drivesdk",
          "cachedResultName": "4. Bright Data Competitive Assortment & Pricing Gap Intelligence Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "e06ac9b6-1f1f-4757-8247-fd8dc368bc75",
      "name": "Log Pricing & Positioning Gaps",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        960,
        1024
      ],
      "parameters": {
        "columns": {
          "value": {
            "price": "={{ $('Normalize & Structure Product Data').item.json.price }}",
            "product": "={{ $json.productName }}",
            "category": "={{ $('Normalize & Structure Product Data').item.json.category }}",
            "competitor": "={{ $json.competitor }}",
            "positioningGap": "={{ $json.positioningGap }}",
            "pricingGapScore": "={{ $json.pricingGapScore }}"
          },
          "schema": [
            {
              "id": "category",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "category",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "competitor",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "product",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "product",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "pricingGapScore",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "pricingGapScore",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "positioningGap",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "positioningGap",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 411547018,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WUZASFK2ztAbOEa-cIe_s_Rjc3nacFd82YbTs4OswmI/edit#gid=411547018",
          "cachedResultName": "Sheet3"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y/edit?usp=drivesdk",
          "cachedResultName": "4. Bright Data Competitive Assortment & Pricing Gap Intelligence Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "e5c3b462-1e3a-451b-8016-0b9dcec4d98a",
      "name": "Format Standard Opportunity Record",
      "type": "n8n-nodes-base.set",
      "position": [
        -192,
        1024
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "b8e4ff1c-c48e-484b-9efb-ae7c8a984510",
              "name": "productName",
              "type": "string",
              "value": "={{ $json.productName }}"
            },
            {
              "id": "667f564a-e0a7-4165-823e-121c8323eb85",
              "name": "competitor",
              "type": "string",
              "value": "={{ $json.competitor }}"
            },
            {
              "id": "d413f15d-5a91-401c-9236-37d6ff6bae9e",
              "name": "cluster",
              "type": "string",
              "value": "={{ $json.cluster }}"
            },
            {
              "id": "bf719aa8-be74-457f-aa19-91f7db98de4f",
              "name": "missingVariants",
              "type": "array",
              "value": "={{ $json.missingVariants }}"
            },
            {
              "id": "ecdcd382-b625-410d-ba5c-a7fa8544c513",
              "name": "bundleOpportunity",
              "type": "string",
              "value": "={{ $json.bundleOpportunity }}"
            },
            {
              "id": "dd73b446-db1f-4114-a8f3-ec874bf9a50e",
              "name": "positioningGap",
              "type": "string",
              "value": "={{ $json.positioningGap }}"
            },
            {
              "id": "a2aacebb-20f1-4de8-bec3-4883a75c3bbf",
              "name": "pricingGapScore",
              "type": "string",
              "value": "={{ $json.pricingGapScore }}"
            },
            {
              "id": "79194352-c099-4adb-9fe5-e06f2e0ba428",
              "name": "Priority",
              "type": "string",
              "value": "Moderate/low"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "7f4ca61e-b0d5-4d96-ba51-0b3514b12e78",
      "name": "Log All Standard Opportunities",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        16,
        1024
      ],
      "parameters": {
        "columns": {
          "value": {
            "cluster": "={{ $json.cluster }}",
            "Priority": "={{ $json.Priority }}",
            "competitor": "={{ $json.competitor }}",
            "productName": "={{ $json.productName }}",
            "positioningGap": "={{ $json.positioningGap }}",
            "missingVariants": "={{ $json.missingVariants }}",
            "pricingGapScore": "={{ $json.pricingGapScore }}",
            "bundleOpportunity": "={{ $json.bundleOpportunity }}"
          },
          "schema": [
            {
              "id": "productName",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "productName",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "competitor",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "competitor",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "cluster",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "cluster",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "missingVariants",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "missingVariants",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "bundleOpportunity",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "bundleOpportunity",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "positioningGap",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "positioningGap",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "pricingGapScore",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "pricingGapScore",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Priority",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Priority",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 780432950,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1WUZASFK2ztAbOEa-cIe_s_Rjc3nacFd82YbTs4OswmI/edit#gid=780432950",
          "cachedResultName": "Sheet4"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y/edit?usp=drivesdk",
          "cachedResultName": "4. Bright Data Competitive Assortment & Pricing Gap Intelligence Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "51496810-582a-4948-873b-bb89aa265f3f",
      "name": "Format Scraping Error Log",
      "type": "n8n-nodes-base.set",
      "position": [
        -2176,
        1056
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "07e3282b-9c4c-44a1-b59f-c5f177e37386",
              "name": "error",
              "type": "boolean",
              "value": true
            },
            {
              "id": "1cd47c32-001b-4533-ac09-ef378a857362",
              "name": "errorSource",
              "type": "string",
              "value": "BrightDataScraper"
            },
            {
              "id": "b03fee3c-e9a7-4193-8a84-f55b460b183a",
              "name": "errorMessage",
              "type": "string",
              "value": "={{$json.error?.message || \"Bright Data scrape failed\"}}"
            },
            {
              "id": "c6ff26b1-817a-415c-9f4f-9a1b633c491c",
              "name": "status",
              "type": "string",
              "value": "SCRAPE_FAILED"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3e0ddd44-520a-4b1c-9aec-c083c1c7cfdc",
      "name": "Log Scraping Failure",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1968,
        1056
      ],
      "parameters": {
        "columns": {
          "value": {
            "error": "={{ $json.error }}",
            "status": "={{ $json.status }}",
            "errorSource": "={{ $json.errorSource }}",
            "errorMessage": "={{ $json.errorMessage }}"
          },
          "schema": [
            {
              "id": "error",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "error",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "errorSource",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "errorSource",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "errorMessage",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "errorMessage",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "status",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "status",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 886905962,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y/edit#gid=886905962",
          "cachedResultName": "log error"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1bEo4B68tlETj76V07-nhz7bOdwezhrhQbCs6VLeqn_Y/edit?usp=drivesdk",
          "cachedResultName": "4. Bright Data Competitive Assortment & Pricing Gap Intelligence Engine"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "338edebb-75ac-49e0-8ead-7a23425b83c9",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3856,
        -16
      ],
      "parameters": {
        "color": 4,
        "width": 512,
        "height": 496,
        "content": "## Competitive Assortment & Pricing Gap Engine\n  \n\nEach product is scored and prioritized automatically.\n\nHigh-impact opportunities are separated from standard ones and logged into structured Google Sheets dashboards for decision-making.\n\nThis system acts as a merchandising intelligence layer for smarter assortment and pricing strategy.\n\nOutput Delivers:\n\n- Missing variants  \n- Bundle opportunities  \n- Positioning gaps  \n- Pricing weaknesses\n\nWhat you need:\n- Bright Data account (for web scraping)\n- OpenRouter API key (for AI analysis)\n- Google Sheets (for output dashboards)\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "28080ff1-154d-45f4-ae3d-800f8f94cc31",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2304,
        448
      ],
      "parameters": {
        "color": 7,
        "width": 576,
        "height": 784,
        "content": "## Product Data Collection & Normalization\n\nScrapes and prepares competitor product data from Amazon for AI-driven analysis.\n\n- Extracts brand, price, availability, and product variants using Bright Data  \n- Collects structured competitor listing data  \n- Normalizes product metadata for consistency  \n- Extracts competitor and variant-level information  \n- Prepares structured dataset for AI clustering  \n- Handles scrape failures with automated error logging  \n\nEnsures clean and consistent inputs for downstream competitive gap detection."
      },
      "typeVersion": 1
    },
    {
      "id": "0eed9878-be19-4b15-b586-68e56e0a04e1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1360,
        384
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 848,
        "content": "## AI Competitive Analysis & Gap Scoring\n\nAnalyzes competitor products using AI to detect assortment and positioning gaps, then scores each opportunity based on potential market impact.\n\n- Clusters product into competitive category  \n- Detects missing variants  \n- Suggests bundle expansion opportunities  \n- Highlights positioning gaps  \n- Scores positioning weaknesses  \n- Evaluates variant gaps  \n- Assesses bundle opportunity potential  \n\nEnables prioritization of high-impact assortment and pricing opportunities."
      },
      "typeVersion": 1
    },
    {
      "id": "0b46efc6-c4bc-4904-a937-40b0885dc4a5",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        608,
        304
      ],
      "parameters": {
        "color": 7,
        "width": 576,
        "height": 928,
        "content": "## High-Priority Opportunity Logging\n\nFormats and logs high-priority competitive opportunities into structured reporting sheets.\n\n- Prepares high-priority opportunity records  \n- Logs missing variant insights  \n- Records bundle opportunity recommendations  \n- Captures pricing and positioning gaps  \n\nEnables focused tracking of high-impact merchandising opportunities."
      },
      "typeVersion": 1
    },
    {
      "id": "2308743c-0399-45ec-9658-4f594b7ebe3a",
      "name": "Competitive Gap Analyzer",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "position": [
        -1232,
        1056
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "ea3174af-771a-4a68-98f8-3dcc79962d98",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3856,
        512
      ],
      "parameters": {
        "color": 4,
        "width": 512,
        "height": 480,
        "content": "## Setup Instructions\n\nBefore running this workflow, configure the following credentials in n8n:\n\n**1. Bright Data API** \u2014 Required for web scraping\n- Sign up at brightdata.com\n- Create an API token\n- Add as \"BrightData account\" credential in n8n\n\n**2. OpenRouter API** \u2014 Required for AI classification\n- Sign up at openrouter.ai\n- Generate an API key\n- Add as \"OpenRouter account\" credential in n8n\n\n**3. Google Sheets OAuth** \u2014 Required for output logging\n- Connect your Google account in n8n\n- See the **Google Sheets Setup** sticky note for required tabs and columns\n- Update each Google Sheets node to point to your new spreadsheet\n\nAfter connecting credentials, edit the configuration node to set your target companies, URLs, or parameters."
      },
      "typeVersion": 1
    },
    {
      "id": "3c7d027a-b844-489f-91bf-88d027b2b665",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3856,
        1024
      ],
      "parameters": {
        "color": 4,
        "width": 508,
        "height": 504,
        "content": "## Google Sheets Setup\n\nCreate a Google Spreadsheet with 5 tabs and add these column headers in row 1:\n\n**Tab: Missing Variants**\nCategory | Competitor | Product | Missing Variants | Priority\n\n**Tab: Bundle Opportunities**\ncategory | product | recommendedVariants | bundleOpportunity | priority\n\n**Tab: Pricing & Positioning Gaps**\ncategory | competitor | product | price | pricingGapScore | positioningGap\n\n**Tab: All Standard Opportunities**\nproductName | competitor | cluster | missingVariants | bundleOpportunity | positioningGap | pricingGapScore | Priority\n\n**Tab: log error**\nerror | errorSource | errorMessage | status\n\nAfter creating the spreadsheet, update each Google Sheets node to point to your document and select the matching tab."
      },
      "typeVersion": 1
    },
    {
      "id": "a68e6713-fea6-47dc-aa14-da28a2568243",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3040,
        480
      ],
      "parameters": {
        "color": 7,
        "width": 496,
        "height": 512,
        "content": "## Input & Configuration\n\nInitial configuration block where the target product URL is defined for competitive analysis.\n\n- Sets the Amazon product page URL  \n- Initiates workflow execution manually  \n- Provides configurable entry point for analysis  \n\nThis allows flexible targeting of competitor products for assortment and pricing intelligence."
      },
      "typeVersion": 1
    },
    {
      "id": "ba01f2f3-d304-4112-adce-d8994668da6d",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        512
      ],
      "parameters": {
        "color": 7,
        "width": 512,
        "height": 720,
        "content": "## Opportunity Filtering & Reporting\n\nFilters prioritized opportunities and routes them to structured reporting dashboards.\n\n- Flags high-priority opportunities based on scoring threshold  \n- Separates standard opportunities for broader analysis  \n- Formats opportunity records for reporting  \n- Logs prioritized insights into Google Sheets dashboards  \n\nSupports data-driven merchandising and pricing decisions."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "05dd51f0-0fd1-4ec5-8c0d-3d3a121bc718",
  "connections": {
    "Set Target URL": {
      "main": [
        [
          {
            "node": "Scrape Product Data (Bright Data)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Competitive Gap Analyzer": {
      "ai_languageModel": [
        [
          {
            "node": "AI Competitive Gap Analyzer",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Run Competitive Analysis": {
      "main": [
        [
          {
            "node": "Set Target URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Scraping Error Log": {
      "main": [
        [
          {
            "node": "Log Scraping Failure",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Competitive Gap Analyzer": {
      "main": [
        [
          {
            "node": "Score Pricing & Assortment Gap",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format High-Priority Record": {
      "main": [
        [
          {
            "node": "Log Missing Variants",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Bundle Opportunities",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Pricing & Positioning Gaps",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is High-Priority Opportunity?": {
      "main": [
        [
          {
            "node": "Format High-Priority Record",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Standard Opportunity Record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate AI Structured Output": {
      "ai_outputParser": [
        [
          {
            "node": "AI Competitive Gap Analyzer",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Score Pricing & Assortment Gap": {
      "main": [
        [
          {
            "node": "Is High-Priority Opportunity?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Scrape Product Data (Bright Data)": {
      "main": [
        [
          {
            "node": "Normalize & Structure Product Data",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Scraping Error Log",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Standard Opportunity Record": {
      "main": [
        [
          {
            "node": "Log All Standard Opportunities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize & Structure Product Data": {
      "main": [
        [
          {
            "node": "AI Competitive Gap Analyzer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}