{
  "id": "coWvrUqPlKc1ULKv",
  "name": "Google Maps Email Scraper",
  "tags": [
    {
      "id": "YCl4LOqJHbMX01uX",
      "name": "Work",
      "createdAt": "2025-11-25T18:11:51.580Z",
      "updatedAt": "2025-11-25T18:11:51.580Z"
    }
  ],
  "nodes": [
    {
      "id": "32d3c93d-16f7-4fae-ae68-7503c1cf2487",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        16,
        224
      ],
      "parameters": {
        "options": {},
        "formTitle": "Olostep lead generation",
        "formFields": {
          "values": [
            {
              "fieldLabel": "City",
              "placeholder": "London",
              "requiredField": true
            },
            {
              "fieldLabel": "business",
              "placeholder": "Dentist",
              "requiredField": true
            }
          ]
        },
        "formDescription": "enter the required fields to start!"
      },
      "typeVersion": 2.3
    },
    {
      "id": "66e69873-1d7a-421d-9a19-4281dba49445",
      "name": "scrape information",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "maxTries": 5,
      "position": [
        192,
        224
      ],
      "parameters": {
        "url": "https://api.olostep.com/v1/scrapes",
        "method": "POST",
        "options": {
          "allowUnauthorizedCerts": true
        },
        "jsonBody": "={\n  \"url_to_scrape\": \"https://www.google.com/maps/search/{{ $json.City }}+{{ $json.business }}\",\n  \"wait_before_scraping\": 100000,\n  \"formats\": [\n    \"json\"\n  ],\n  \"remove_css_selectors\": \"default\",\n  \"actions\": [\n      {\n        \"type\": \"wait\",\n        \"milliseconds\": 10000\n    },\n    {\n        \"type\": \"click\",\n        \"selector\": \".PLbyfe\"\n    },\n    {\n        \"type\": \"scroll\",\n        \"direction\": \"down\",\n        \"amount\": 100\n    },\n    {\n        \"type\": \"wait\",\n        \"milliseconds\": 10000\n    },\n    {\n        \"type\": \"scroll\",\n        \"direction\": \"down\",\n        \"amount\": 1000\n    }\n  ],\n  \"country\": \"US\",\n  \"transformer\": \"none\",\n  \"remove_images\": false,\n  \"remove_class_names\": [],\n  \"parser\": {},\n  \"llm_extract\": {\n    \"schema\": {\n      \"type\": \"array\",\n      \"description\": \"A list of businesses found on the Google Maps search results page.\",\n      \"items\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"name\": {\n            \"type\": \"string\",\n            \"description\": \"The name of the business or place.\"\n          },\n          \"website\": {\n            \"type\": \"string\",\n            \"description\": \"The official website URL for the business.\"\n          },\n          \"location\": {\n            \"type\": \"string\",\n            \"description\": \"A short snippet of the business address or location.\"\n          },\n          \"phone_number\": {\n            \"type\": \"string\",\n            \"description\": \"The phone number of the business or place.\"\n          }\n        },\n        \"required\": [\n          \"name\",\n          \"website_url\"\n        ]\n      }\n    }\n  },\n  \"links_on_page\": {\n    \"absolute_links\": true,\n    \"query_to_order_links_by\": \"\",\n    \"include_links\": [],\n    \"exclude_links\": []\n  },\n  \"screen_size\": {\n    \"screen_type\": \"desktop\",\n    \"screen_width\": 1920,\n    \"screen_height\": 1080\n  },\n  \"screenshot\": {\n    \"full_page\": true\n  },\n  \"metadata\": {}\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <token>"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "ff68a87c-20cc-47c3-9788-faf9f87c7e16",
      "name": "parsedInfo",
      "type": "n8n-nodes-base.set",
      "position": [
        384,
        224
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "21d26317-c9bc-4a56-a3ca-962254a23329",
              "name": "parsedJson",
              "type": "array",
              "value": "={{ $json.result.json_content.replace(/\\\\/g, '') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bbcf75cb-44cc-4ab3-8212-52ef0dac32cc",
      "name": "Split Out",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        576,
        224
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "parsedJson"
      },
      "typeVersion": 1
    },
    {
      "id": "fafd4e96-ce1b-44e0-93b7-af11655827c5",
      "name": "Remove Duplicates",
      "type": "n8n-nodes-base.removeDuplicates",
      "position": [
        784,
        224
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 2
    },
    {
      "id": "8278eaef-e00a-4eef-bbbe-8516f931b528",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        16,
        560
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "34237cac-c410-42ae-9864-5729e169f5b7",
      "name": "scrape the name",
      "type": "n8n-nodes-base.httpRequest",
      "onError": "continueRegularOutput",
      "maxTries": 5,
      "position": [
        224,
        576
      ],
      "parameters": {
        "url": "https://api.olostep.com/v1/scrapes",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"url_to_scrape\": \"{{ $json.website}}\",\n  \"wait_before_scraping\": 10000,\n  \"formats\": [\n    \"json\"\n  ],\n  \"remove_css_selectors\": \"default\",\n  \"actions\": [],\n  \"country\": \"US\",\n  \"transformer\": \"none\",\n  \"remove_images\": false,\n  \"remove_class_names\": [],\n  \"parser\": {},\n  \"llm_extract\": {\n    \"schema\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"firstName\": {\n          \"type\": \"string\",\n          \"description\": \"The first name of the CEO or the decision maker in the business.\"\n        },\n        \"lastName\": {\n          \"type\": \"string\",\n          \"description\": \"The last name of the CEO or the decision maker in the business.\"\n        },\n        \"email\": {\n          \"type\": \"string\",\n          \"description\": \"The email of the business.\"\n        }\n      },\n      \"required\": [\n        \"firstName\",\n        \"lastName\"\n      ]\n    }\n  },\n  \"links_on_page\": {\n    \"absolute_links\": true,\n    \"query_to_order_links_by\": \"\",\n    \"include_links\": [],\n    \"exclude_links\": []\n  },\n  \"screen_size\": {\n    \"screen_type\": \"default\",\n    \"screen_width\": 123,\n    \"screen_height\": 123\n  },\n  \"screenshot\": {\n    \"full_page\": true\n  },\n  \"metadata\": {}\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer <token>"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.2
    },
    {
      "id": "6bf2474d-1726-4f1c-b56f-e5147a474d43",
      "name": "name",
      "type": "n8n-nodes-base.set",
      "position": [
        448,
        576
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "84418856-fc82-4eb7-9df8-767acb3a073d",
              "name": "parsedJson",
              "type": "object",
              "value": "={{ $json.result.json_content.replace(/\\\\/g, '') }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "2530f193-3336-4829-a579-47064a44559c",
      "name": "Append row in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "maxTries": 5,
      "position": [
        640,
        576
      ],
      "parameters": {
        "columns": {
          "value": {
            "name": "={{ $('Loop Over Items').item.json.name || \"not found\" }}",
            "website": "={{ $('Loop Over Items').item.json.website || \"not found\" }}",
            "location": "={{ $('Loop Over Items').item.json.location || \"locaation\" }}",
            "phoneNumber": "=\"{{ $('Loop Over Items').item.json.phone_number || \"not found\" }}\"",
            "contactEmail": "={{ $json.parsedJson.email || \"not found\"}}",
            "decisionMaker name": "={{ $('name').item.json.parsedJson.firstName || \"not found\" }} {{ $('name').item.json.parsedJson.lastName || \"\" }}"
          },
          "schema": [
            {
              "id": "name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "location",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "location",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "website",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "phoneNumber",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "phoneNumber",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "decisionMaker name",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "decisionMaker name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "contactEmail",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "contactEmail",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 900434725,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IoiN3ISmNrxOOWcfw1bQQb6Ru2GV0aN4wbXxGA73LCY/edit#gid=900434725",
          "cachedResultName": "leads"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1IoiN3ISmNrxOOWcfw1bQQb6Ru2GV0aN4wbXxGA73LCY",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1IoiN3ISmNrxOOWcfw1bQQb6Ru2GV0aN4wbXxGA73LCY/edit?usp=drivesdk",
          "cachedResultName": "Olostep leads"
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.7
    },
    {
      "id": "eeeb7fa6-15d1-4220-8ae9-69ebc397b1db",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        816,
        576
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "f74d532a-d838-4eb4-a560-ebaed0201077",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -32,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 192,
        "height": 304,
        "content": "## Form Trigger  \nEnter city + business type to begin scraping."
      },
      "typeVersion": 1
    },
    {
      "id": "9e7a570d-ee67-44f4-aa2d-ad7aa4604f23",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        176,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 192,
        "height": 304,
        "content": "## Google Maps Scrape  \nExtracts business name, location, website, phone number."
      },
      "typeVersion": 1
    },
    {
      "id": "deb02e02-7bfa-4cba-9e3c-b2403351d8fd",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 528,
        "height": 288,
        "content": "## Clean Data  \nSplit JSON \u2192 Remove duplicates \u2192 Loop through businesses."
      },
      "typeVersion": 1
    },
    {
      "id": "1134989b-27b3-442d-bd7d-e5090cc88fe2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        464
      ],
      "parameters": {
        "color": 7,
        "width": 400,
        "height": 272,
        "content": "## Website Scrape  \nScrapes each business's website to find CEO / Founder info."
      },
      "typeVersion": 1
    },
    {
      "id": "476d1723-bae5-4a33-80f0-4395a64e08fb",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        480
      ],
      "parameters": {
        "color": 7,
        "width": 320,
        "height": 256,
        "content": "## Save Lead  \nAppends results to Google Sheets with all captured fields."
      },
      "typeVersion": 1
    },
    {
      "id": "d97d9d79-b95f-49c0-b3e4-4171b39a45c3",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        464
      ],
      "parameters": {
        "color": 7,
        "width": 208,
        "height": 272,
        "content": "## Clean Data \nset first name, last name, and email each in it's proper field. "
      },
      "typeVersion": 1
    },
    {
      "id": "a473611e-4c31-4c04-9ed9-6e815cd48136",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        -80
      ],
      "parameters": {
        "width": 608,
        "height": 1264,
        "content": "# Olostep Google Maps Lead Generation Automation  \n\nThis n8n template automates lead generation by scraping Google Maps using the Olostep API.  \nIt extracts **business names, locations, websites, phone numbers, and decision-maker names** (CEO, Founder, etc.) directly from the business website \u2014 and saves everything into a Google Sheet.\n\n## How it works / What it does  \n1. **Form Trigger:**  \n   - User submits a form with: **City** + **Business Type** (e.g., \"Dentist in Miami\").\n\n2. **Google Maps Scraping:**  \n   - The workflow sends the query to the Olostep scraping API.  \n   - Extracts:  \n     - Business name  \n     - Location  \n     - Website  \n     - Phone number  \n\n3. **Clean the Data:**  \n   - Parsed JSON is split into items.  \n   - A Remove Duplicates node ensures only unique leads continue.\n\n4. **Loop Through Each Business:**  \n   - For every business, the workflow triggers a second Olostep scrape \u2014 this time on the **business\u2019s website**.  \n   - It extracts:  \n     - First name of decision-maker  \n     - Last name of decision-maker  \n     - (Optional) general contact email found on the website\n\n5. **Store the Lead:**  \n   - The final combined lead is appended to a Google Sheet with these fields:  \n     - Business Name  \n     - Location  \n     - Website  \n     - Phone Number  \n     - Decision-Maker Name  \n     - Contact Email (if found)  \n\n6. **Loop & Wait:**  \n   - A wait step ensures you stay within rate limits while scraping multiple websites.\n\nThis produces a clean, enriched list of leads ready for outreach or CRM import.\n\n## How to set up  \n1. Import the template into your n8n workspace.  \n2. Add your **Olostep API key**.  \n3. Connect **Google Sheets** for output storage.  \n4. Publish your form to collect search requests.  \n5. Run the workflow \u2014 leads will appear automatically in your sheet."
      },
      "typeVersion": 1
    },
    {
      "id": "bd25f74b-d820-4f51-8261-b54c6030b9a7",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        768
      ],
      "parameters": {
        "color": 3,
        "width": 384,
        "height": 176,
        "content": "## WARNING\nIf the http request runs through a 504 gateway timeout error, that's because the \"llm_extract\".\n\nYou can remove all the fields in the schema (inside the llm_extract) and then use an information extractor node or llm node to extract the desired information."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "e4065e68-083a-494c-88ad-aedd9e83e33e",
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "name": {
      "main": [
        [
          {
            "node": "Append row in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split Out": {
      "main": [
        [
          {
            "node": "Remove Duplicates",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parsedInfo": {
      "main": [
        [
          {
            "node": "Split Out",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "scrape the name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "scrape the name": {
      "main": [
        [
          {
            "node": "name",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Remove Duplicates": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "scrape information",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "scrape information": {
      "main": [
        [
          {
            "node": "parsedInfo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append row in sheet": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}