{
  "id": "afm3YninxoDhc0hu",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Amazon Price Tracker and Competitor Comparison Workflow",
  "tags": [],
  "nodes": [
    {
      "id": "93168663-49d8-4533-9dc4-67a18844458c",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "triggerAtHour": 8
            }
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6662de5f-e9b6-4b15-970d-816c0bf5199c",
      "name": "Get row(s) in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        272,
        0
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hr4e9y0z2LK0N8N7R5xgZjuH3nW_OU5AcOtew9H6NaM/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1hr4e9y0z2LK0N8N7R5xgZjuH3nW_OU5AcOtew9H6NaM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hr4e9y0z2LK0N8N7R5xgZjuH3nW_OU5AcOtew9H6NaM/edit?usp=drivesdk",
          "cachedResultName": "Untitled spreadsheet"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "872aed3d-5d6a-426a-82bc-799b40724fee",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        544,
        0
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "23197cee-867e-412c-9c49-bf1ace88ed2a",
      "name": "Run an Actor",
      "type": "@apify/n8n-nodes-apify.apify",
      "onError": "continueRegularOutput",
      "position": [
        848,
        -16
      ],
      "parameters": {
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "BG3WDrGdteHgZgbPK",
          "cachedResultUrl": "https://console.apify.com/actors/BG3WDrGdteHgZgbPK/input",
          "cachedResultName": "Amazon Product Scraper (junglee/Amazon-crawler)"
        },
        "customBody": "={\n  \"categoryOrProductUrls\": [\n    {\n      \"url\": \"{{ $json['Amazon S3P (Revlon)'] }}\"\n    },\n    {\n      \"url\": \"{{ $json['Amazon P3P (RK)'] }}\"\n    }\n  ]\n}"
      },
      "credentials": {
        "apifyApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "6baad89a-0e78-4077-85a1-9ef3584e2b41",
      "name": "HTTP Request1",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "position": [
        16,
        288
      ],
      "parameters": {
        "url": "=https://api.apify.com/v2/datasets/{{ $json.defaultDatasetId }}/items?token={your_apify_api_YOUR_TOKEN_HERE}",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "9a13d367-e11f-4b56-830e-39d399e742d7",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        752,
        256
      ],
      "parameters": {
        "columns": {
          "value": {
            "RK Price": "={{ $json.rkPrice }}",
            "Revlon Price": "={{ $json.revlonPrice }}",
            "Material Name": "={{ $json.materialName }}"
          },
          "schema": [
            {
              "id": "Category Name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Category Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Material Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Material Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amazon S3P (Revlon)",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Amazon S3P (Revlon)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Revlon Price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Revlon Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amazon P3P (RK)",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Amazon P3P (RK)",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "RK Price",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "RK Price",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Material Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hr4e9y0z2LK0N8N7R5xgZjuH3nW_OU5AcOtew9H6NaM/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1hr4e9y0z2LK0N8N7R5xgZjuH3nW_OU5AcOtew9H6NaM",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1hr4e9y0z2LK0N8N7R5xgZjuH3nW_OU5AcOtew9H6NaM/edit?usp=drivesdk",
          "cachedResultName": "Amazon Price Update"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "50053e6d-b69e-4c32-bc36-9f15c1dc1dcf",
      "name": "Code in JavaScript",
      "type": "n8n-nodes-base.code",
      "onError": "continueRegularOutput",
      "position": [
        336,
        288
      ],
      "parameters": {
        "jsCode": "// Get both product results\nconst items = $input.all();\n\n// Extract prices from both products\nconst price1 = items[0]?.json?.price?.value || items[0]?.json?.listPrice?.value || 'N/A';\nconst price2 = items[1]?.json?.price?.value || items[1]?.json?.listPrice?.value || 'N/A';\n\n// Get the original row data from Loop Over Items\nconst originalRow = $('Loop Over Items').item.json;\n\nreturn [{\n  json: {\n    rowNumber: originalRow.row_number,\n    MyListingPrice: price1,\n    OtherSellerPrice: price2,\n    categoryName: originalRow['Category Name'],\n    materialName: originalRow['Material Name'],\n    lastUpdated: new Date().toLocaleString('en-IN', { timeZone: 'Asia/Kolkata' })\n  }\n}];"
      },
      "typeVersion": 2
    },
    {
      "id": "c2c8da3a-23b7-401f-a432-1facb40fdebd",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        -112
      ],
      "parameters": {
        "color": 5,
        "height": 272,
        "content": "## Auto-start workflow daily"
      },
      "typeVersion": 1
    },
    {
      "id": "f7741ff6-4c9f-49cb-971a-6e66c1720a31",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        -112
      ],
      "parameters": {
        "color": 3,
        "height": 272,
        "content": "## Fetch product row data"
      },
      "typeVersion": 1
    },
    {
      "id": "b546ef04-1c14-47f3-8128-c3030c1c563f",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        480,
        -112
      ],
      "parameters": {
        "color": 7,
        "height": 272,
        "content": "## Process each row (one-by-one)"
      },
      "typeVersion": 1
    },
    {
      "id": "de832710-985d-4251-8166-44af95d8e890",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        752,
        -112
      ],
      "parameters": {
        "color": 5,
        "width": 304,
        "height": 272,
        "content": "## Scrape Amazon data"
      },
      "typeVersion": 1
    },
    {
      "id": "60448e00-c4b7-40da-86fa-4bf052241993",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -64,
        192
      ],
      "parameters": {
        "color": 2,
        "width": 272,
        "height": 256,
        "content": "## Fetch Apify output"
      },
      "typeVersion": 1
    },
    {
      "id": "b1766657-17ac-4bd6-abd2-4df0cfea3f63",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        192
      ],
      "parameters": {
        "color": 4,
        "width": 288,
        "height": 256,
        "content": "## Extract price data"
      },
      "typeVersion": 1
    },
    {
      "id": "0a1eec58-4e4e-4a34-a5bb-8777d28dc95f",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        192
      ],
      "parameters": {
        "color": 5,
        "width": 496,
        "height": 256,
        "content": "## Update data to sheet"
      },
      "typeVersion": 1
    },
    {
      "id": "107bb2ec-bd03-492b-96e9-769679c74471",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -992,
        -224
      ],
      "parameters": {
        "width": 816,
        "height": 864,
        "content": "## Amazon Price Tracker & Competitor Monitor (n8n + Apify + Google Sheets)\n\nThis workflow automatically tracks Amazon product prices by scraping listing and competitor URLs through Apify and updating your Google Sheet daily. \n\nIt\u2019s designed for Amazon sellers, founders, and growth teams who want hands-off price monitoring, competitive intelligence, and Buy Box readiness. \n\nYou can track unlimited products and competitors by simply adding more columns and extending the nodes.\n\nHow it works:\n\n- Loads product rows + competitor URLs from Google Sheets\n- Loops through each row\n- Sends Amazon URLs to Apify\u2019s Amazon Product Scraper\n- Retrieves the scraper output via HTTP\n- JavaScript node extracts and formats price fields\n- Updates each row in Google Sheets with the latest prices\n- Supports unlimited competitors via simple column/node extensions\n\nSetup steps:\n\n- Add your product and competitor URLs in a Google Sheet\n- Add Apify API token (Amazon Scraper requires a $40/month plan with 14-day trial)\n- Connect Google Sheets credentials in n8n\n- Update Sheet ID + range inside the Google Sheets nodes\n- Run once manually to verify output\n- Extend the workflow anytime by adding new competitor columns, mapping them in Apify \u2192 Code \u2192 Update Row\n\nCustomization:\n\n- Add alerts when prices drop\n- Add Buy Box owner detection\n- Add Slack/Email notifications\n- Scale to unlimited competitors by duplicating the column mapping chain\n\nNeed Help?\nConnect with me at imarunavadas@gmail.com"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "timezone": "Asia/Kolkata",
    "callerPolicy": "workflowsFromSameOwner",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "37138b69-6112-4829-b28f-4819d05aa8b5",
  "connections": {
    "Run an Actor": {
      "main": [
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Code in JavaScript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Run an Actor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get row(s) in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code in JavaScript": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get row(s) in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}