{
  "name": "Extract product details from search result URLs with MrScraper and Google Sheets",
  "nodes": [
    {
      "id": "2c20b891-738d-4f97-b047-3ec77c92393d",
      "name": "Extract All Url ",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        464
      ]
    },
    {
      "id": "1236a0af-6596-46ed-a79b-fae29e2acea7",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -288,
        480
      ]
    },
    {
      "id": "f15d8061-1638-4aad-ab5d-c0be2c86fcaf",
      "name": "Flatten Object",
      "type": "n8n-nodes-base.code",
      "position": [
        1168,
        464
      ]
    },
    {
      "id": "a8477940-b5ed-4627-8468-0ff25bd641b9",
      "name": "Looping Listing Page url",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        320,
        480
      ]
    },
    {
      "id": "61437fa8-a7dd-481a-bef7-fdd2bac81e42",
      "name": "Looping Detail Page url",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        976,
        496
      ]
    },
    {
      "id": "e66f7c5e-2a09-4907-97d8-a47b8b9a2668",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        416
      ],
      "parameters": {
        "width": 720,
        "height": 672,
        "content": "## Phase 0: Setup and Configuration\n### Goal\nPrepare the MrScraper agents, Google Sheets, and n8n credentials so the workflow can run reliably. Also, make sure to create a scraper in MrScraper beforeh"
      }
    },
    {
      "id": "29395412-7f02-4cc7-b40f-36dbbf287cf3",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        656
      ],
      "parameters": {
        "width": 624,
        "height": 352,
        "content": "### Goal\nRetrieve all target search/listing page URLs stored in Google Sheets for use in the n8n workflow.\n\n### What To Do\n1. Use the **Google Sheets** node and select the **Read Rows** operation.\n2. "
      }
    },
    {
      "id": "0be7617a-9a3a-40d2-ad91-05cfa9e3078a",
      "name": "Run listing agent scraper",
      "type": "n8n-nodes-mrscraper.mrscraper",
      "position": [
        688,
        512
      ]
    },
    {
      "id": "4cc501d6-9527-4258-89b5-0d8cd9db9a16",
      "name": "Run general agent scraper",
      "type": "n8n-nodes-mrscraper.mrscraper",
      "position": [
        1312,
        496
      ]
    },
    {
      "id": "f2b62ecb-76ca-4d28-b143-405d56293ff1",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1936,
        480
      ]
    },
    {
      "id": "87bd29a3-f121-44da-a34d-27b25e47a0bf",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        416
      ],
      "parameters": {
        "width": 624,
        "height": 224,
        "content": "## Phase 1: Load List search Page Url"
      }
    },
    {
      "id": "05a40a40-ec5c-45e0-8f8f-8250f8473c1b",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        416
      ],
      "parameters": {
        "width": 624,
        "height": 304,
        "content": "## Phase 2: Scrape Listing Page\n"
      }
    },
    {
      "id": "15f52a25-622a-4749-a7d8-f2ed139c76f5",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        736
      ],
      "parameters": {
        "width": 624,
        "height": 288,
        "content": "### Goal\nFrom each listing/search page, extract **detail page URLs**.\n\n### What To Do\n1. Loop through each listing page URL from Phase 1.\n2. For each URL, call the **Listing Agent (Rerun)** using the "
      }
    },
    {
      "id": "6c65be49-d48c-4c40-b03c-9a8389399ed1",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        416
      ],
      "parameters": {
        "width": 624,
        "height": 304,
        "content": "## Phase 3: Scrape Detail Data\n"
      }
    },
    {
      "id": "fb6302dd-4925-46e6-a7e3-ffb2cf4a86f8",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        736
      ],
      "parameters": {
        "width": 624,
        "height": 400,
        "content": "### Goal\nExtract structured fields from each detail page.\n\n### What To Do\n1. Loop through each detail URL from Phase 2.\n2. For each URL, call the **General Agent (Rerun)** using the scraperId from the"
      }
    },
    {
      "id": "6acb60f0-6dba-42de-bd4f-becc916c4b95",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        656
      ],
      "parameters": {
        "width": 592,
        "height": 432,
        "content": "### Goal\nSave results into Google Sheets and send a Gmail summary/alert.\n\n### What To Do\n1. Write rows into **Google Sheets**:\n   * Append new rows, or upsert using a unique key (recommended: `source_"
      }
    },
    {
      "id": "81c0127b-ae9d-4728-9ba0-daaca7f756ba",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        416
      ],
      "parameters": {
        "width": 592,
        "height": 224,
        "content": "## Phase 4: Export to Spreadsheet + Notify via Gmail"
      }
    },
    {
      "id": "179d0db2-b7a0-43c8-b417-a0af14cc7044",
      "name": "Get List Search Page",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        0,
        480
      ]
    },
    {
      "id": "2fbb77f0-813d-432e-a127-8e2bd911950c",
      "name": "Append or update row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1648,
        480
      ]
    }
  ],
  "connections": {
    "Flatten Object": {
      "main": [
        [
          {
            "node": "Append or update row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract All Url ": {
      "main": [
        [
          {
            "node": "Looping Detail Page url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get List Search Page": {
      "main": [
        [
          {
            "node": "Looping Listing Page url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Looping Detail Page url": {
      "main": [
        [
          {
            "node": "Flatten Object",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run general agent scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Looping Listing Page url": {
      "main": [
        [
          {
            "node": "Extract All Url ",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Run listing agent scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run general agent scraper": {
      "main": [
        [
          {
            "node": "Looping Detail Page url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run listing agent scraper": {
      "main": [
        [
          {
            "node": "Looping Listing Page url",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append or update row in sheet": {
      "main": [
        [
          {
            "node": "Send a message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Execute workflow’": {
      "main": [
        [
          {
            "node": "Get List Search Page",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}