{
  "name": "Turn websites into a Google Sheets database with MrScraper and Gmail",
  "nodes": [
    {
      "id": "f2cbcbb3-d744-4805-9f21-bb373e57294e",
      "name": "Extract All Url ",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        464
      ]
    },
    {
      "id": "46c25881-e096-472d-856b-58b19889ca47",
      "name": "When clicking ‘Execute workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -288,
        480
      ]
    },
    {
      "id": "ba27b8ff-de07-445b-99e1-f91b4d5185f9",
      "name": "Flatten Object",
      "type": "n8n-nodes-base.code",
      "position": [
        1168,
        464
      ]
    },
    {
      "id": "bf8dd01b-029a-40e0-bbce-05c72c007843",
      "name": "Looping Listing Page url",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        320,
        480
      ]
    },
    {
      "id": "68262d46-6f6f-4180-9d68-7c0e1ac2db7f",
      "name": "Looping Detail Page url",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        976,
        496
      ]
    },
    {
      "id": "b17fd342-7d85-4eab-9e2f-d6a1c7b13a1e",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1152,
        416
      ],
      "parameters": {
        "width": 720,
        "height": 976,
        "content": "## Phase 0: Setup and Configuration\n\n### Goal\n\nPrepare your MrScraper agents + n8n credentials so the workflow can run reliably.\n\n### What you need before running\n\n1. **Create the scrapers in your MrS"
      }
    },
    {
      "id": "ba037af9-3691-4760-90f9-8110099d86f7",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        656
      ],
      "parameters": {
        "width": 624,
        "height": 288,
        "content": "### Goal\nFind listing/search pages automatically from a domain.\n\n### What To Do\n1. Run **Map Agent (Rerun)** using your domain as input (Please enter the maximum depth, maximum pages, and include patt"
      }
    },
    {
      "id": "e3ecd221-28f3-4657-a78d-1c495a5d940c",
      "name": "Run listing agent scraper",
      "type": "n8n-nodes-mrscraper.mrscraper",
      "position": [
        688,
        512
      ]
    },
    {
      "id": "3711e6c8-3586-4fc7-9e19-c2569325e405",
      "name": "Run general agent scraper",
      "type": "n8n-nodes-mrscraper.mrscraper",
      "position": [
        1312,
        496
      ]
    },
    {
      "id": "c20c557a-9d73-4671-a476-3e9e54905e85",
      "name": "Run map agent scraper",
      "type": "n8n-nodes-mrscraper.mrscraper",
      "position": [
        -16,
        480
      ]
    },
    {
      "id": "5ea9af70-7382-4670-bc6c-9ba0c73c2de2",
      "name": "Send a message",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1936,
        480
      ]
    },
    {
      "id": "9c70a124-d1d0-40ad-885e-df580a26b952",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        416
      ],
      "parameters": {
        "width": 624,
        "height": 224,
        "content": "## Phase 1: Discover URL (Crawling)"
      }
    },
    {
      "id": "c5a12156-b27a-4931-9b67-784ff72636b8",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        416
      ],
      "parameters": {
        "width": 624,
        "height": 304,
        "content": "## Phase 2: Scrape Listing Page\n"
      }
    },
    {
      "id": "8ddced76-2ae6-45a8-9c86-5a4c9b4b3c80",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        240,
        736
      ],
      "parameters": {
        "width": 624,
        "height": 320,
        "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": "6be9e8e7-f239-4976-bdd2-2d7ef235024e",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        416
      ],
      "parameters": {
        "width": 624,
        "height": 304,
        "content": "## Phase 3: Scrape Detail Data\n"
      }
    },
    {
      "id": "109b0272-6dae-4771-a912-a1ce9e2a3fb1",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        880,
        736
      ],
      "parameters": {
        "width": 624,
        "height": 368,
        "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": "da5aae6f-ec98-4072-ac6a-04533ec5704c",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1520,
        656
      ],
      "parameters": {
        "width": 592,
        "height": 416,
        "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": "434625d8-040d-46c5-a367-4e43731d02aa",
      "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": "8c8ec7f3-5318-4984-b03f-d866053a2dfa",
      "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
          }
        ]
      ]
    },
    "Run map agent scraper": {
      "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": "Run map agent scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}