{
  "name": "Google Maps leads, then their owners or decision makers, to Google Sheets",
  "nodes": [
    {
      "id": "8ada2d47-c2c8-5519-8703-5c01cb5bdf47",
      "name": "Overview",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -720,
        0
      ],
      "parameters": {
        "content": "## Google Maps leads, then their owners or decision makers, to Google Sheets\n\n### How it works\nFor agencies and B2B sales teams who sell to local businesses. Every Monday at 08:00, the workflow runs [Google Maps Scraper](https://apify.com/aurelix/google-maps-scraper) and then [Decision Maker Finder](https://apify.com/aurelix/decision-maker-finder) on Apify and finds local businesses on Google Maps for a trade and city, runs Decision Maker Finder on their websites, and appends one row per owner, partner or manager to a Google Sheet with the business name and phone; businesses whose website names nobody are skipped and cost nothing in step 2.\n\n### Setup\n1. Install the **Apify** node (verified community node: on n8n Cloud search *Apify* in the nodes panel and click Install; self-hosted: Settings > Community nodes > `@apify/n8n-nodes-apify`). Create an **Apify API** credential with your API token (Apify Console > Settings > API & Integrations) and select it on the Apify node. Tested with `@apify/n8n-nodes-apify` 0.9.0 on n8n 2.46; install guide: https://docs.apify.com/platform/integrations/n8n\n2. Create a **Google Sheets OAuth2** credential and select it on **Append rows to sheet**. Make a sheet tab (name in the Set node) whose header row is the column list in the Deliver note.\n3. Open **Set search** and change the values: what to search, the Google Sheets target, and the two spend caps.\n4. Run once by hand, check the result, then activate.\n\n### Cost\nStep 1 costs $0.85 per 1,000 places plus a small start fee; step 2 $0.90 per 1,000 people found plus a small start fee (free-plan prices). With the defaults (25 places) a run costs a few cents. `maxChargeMapsUsd` and `maxChargePeopleUsd` cap each step.\n\n### Limitations\nNeeds an Apify account (Apify bills the Actor's results to it) and the Apify community node. Runs that fail or hit `maxChargeUsd` stop the workflow at the Apify node; check the run in Apify Console.\n\n### Customization\nChange the seniorities in the second Apify node's JSON (`founder_owner`, `c_suite`, `partner`, `manager`, `vp`, `head`, `director`) or add `functions` such as `sales` or `marketing`. Many small businesses name nobody on their site; expect people for a minority of them.",
        "height": 900,
        "width": 640
      }
    },
    {
      "id": "ff2a486f-ad5a-5488-80b3-cfedec97a223",
      "name": "Two steps",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        220,
        140
      ],
      "parameters": {
        "content": "## Two steps\nStep 1 lists businesses on Google Maps. Step 2 reads their websites for owners and managers. Edit the search and both spend caps in **Set search**.",
        "height": 340,
        "width": 1060,
        "color": 7
      }
    },
    {
      "id": "241dc9f2-6eb1-5596-9edc-f706f34c3d0b",
      "name": "Every Monday at 08:00",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        0,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "weeks",
              "triggersAtDay": [
                1
              ],
              "triggerAtHour": 8
            }
          ]
        }
      }
    },
    {
      "id": "491f12cf-7276-5cc2-a107-8919aabe6cd3",
      "name": "Set search",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        260,
        300
      ],
      "parameters": {
        "mode": "manual",
        "assignments": {
          "assignments": [
            {
              "id": "160f08e8-f96e-5e9a-909e-45a1fbd4229b",
              "name": "searchTerms",
              "value": "[\"roofing contractor\"]",
              "type": "array"
            },
            {
              "id": "59dc2fb1-e3e7-52c5-bad9-66346f4825a5",
              "name": "locations",
              "value": "[\"Dallas, TX\"]",
              "type": "array"
            },
            {
              "id": "d9721f7b-e7d3-5216-8558-efa2a1931a09",
              "name": "maxPlaces",
              "value": 25,
              "type": "number"
            },
            {
              "id": "39b57dce-2a3f-59d9-a7fd-bc6bf7293c3f",
              "name": "maxChargeMapsUsd",
              "value": 0.05,
              "type": "number"
            },
            {
              "id": "6bbb79e6-1181-5e00-b507-20fbf60df34b",
              "name": "maxChargePeopleUsd",
              "value": 0.1,
              "type": "number"
            },
            {
              "id": "6974b545-467a-5a23-8238-e026cb91e5f7",
              "name": "spreadsheetUrl",
              "value": "https://docs.google.com/spreadsheets/d/YOUR_SPREADSHEET_ID/edit",
              "type": "string"
            },
            {
              "id": "7a7767a3-db35-52a6-a26c-bc77bdff4c0d",
              "name": "sheetTab",
              "value": "Owners",
              "type": "string"
            }
          ]
        },
        "options": {}
      }
    },
    {
      "id": "ec0003d9-c35a-54a3-a9b9-980eefc027db",
      "name": "Run Google Maps Scraper",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 1,
      "position": [
        520,
        300
      ],
      "parameters": {
        "resource": "Actors",
        "operation": "Run actor and get dataset",
        "actorSource": "store",
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "ldJmkkq2Q5dBhMyU9",
          "cachedResultName": "Google Maps Scraper (aurelix/google-maps-scraper)",
          "cachedResultUrl": "https://console.apify.com/actors/ldJmkkq2Q5dBhMyU9/input"
        },
        "actorInputMode": "json",
        "customBody": "={{ JSON.stringify({ searchTerms: $json.searchTerms, locations: $json.locations, maxResultsPerSearch: $json.maxPlaces }) }}",
        "memory": 256,
        "timeout": 900,
        "maxTotalChargeUsd": "={{ $('Set search').first().json.maxChargeMapsUsd }}"
      }
    },
    {
      "id": "11676e3f-48cb-5c7b-9f8c-be428b4ef0ca",
      "name": "Collect websites",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        780,
        300
      ],
      "parameters": {
        "jsCode": "const host = u => String(u || '').toLowerCase().replace(/^https?:\\/\\//, '').split(/[\\/?#:]/)[0].replace(/^www\\./, '');\nconst skip = /(facebook|instagram|google|yelp|linktr\\.ee|business\\.site)/;\nconst domains = [...new Set($input.all().map(i => host(i.json.website || '')).filter(h => h && !skip.test(h)))];\nif (!domains.length) return [];\nreturn [{ json: { domains } }];"
      }
    },
    {
      "id": "c50ce312-2152-5566-88fa-5d87f370d5e3",
      "name": "Run Decision Maker Finder",
      "type": "@apify/n8n-nodes-apify.apify",
      "typeVersion": 1,
      "position": [
        1040,
        300
      ],
      "parameters": {
        "resource": "Actors",
        "operation": "Run actor and get dataset",
        "actorSource": "store",
        "actorId": {
          "__rl": true,
          "mode": "list",
          "value": "KxUyCSNyysD86a4Za",
          "cachedResultName": "Decision Maker Finder (aurelix/decision-maker-finder)",
          "cachedResultUrl": "https://console.apify.com/actors/KxUyCSNyysD86a4Za/input"
        },
        "actorInputMode": "json",
        "customBody": "={{ JSON.stringify({ domains: $json.domains, seniorities: ['founder_owner', 'c_suite', 'partner', 'manager'], maxPagesPerDomain: 6, maxPeoplePerCompany: 5 }) }}",
        "memory": 256,
        "timeout": 900,
        "maxTotalChargeUsd": "={{ $('Set search').first().json.maxChargePeopleUsd }}"
      }
    },
    {
      "id": "15da4230-1482-515c-b4e8-14cb8918ff0e",
      "name": "Join",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1300,
        300
      ],
      "parameters": {
        "jsCode": "const host = u => String(u || '').toLowerCase().replace(/^https?:\\/\\//, '').split(/[\\/?#:]/)[0].replace(/^www\\./, '');\nconst places = $('Run Google Maps Scraper').all().map(i => i.json);\nconst byHost = {};\nfor (const p of places) { const h = host(p.website || ''); if (h && !byHost[h]) byHost[h] = p; }\nreturn $input.all().map(i => i.json).filter(p => p.name).map(p => { const b = byHost[host(p.domain || p.website || '')] || {};\n  return { json: { scraped_at: p.scraped_at ?? '', business: b.name ?? p.company_name ?? '', business_phone: b.phone ?? '', city: b.city ?? '', website: p.website ?? '', name: p.name, title: p.title ?? '', seniority: p.seniority ?? '', work_email: p.work_email ?? '', work_phone: p.work_phone ?? '', linkedin_url: p.linkedin_url ?? '', source_url: p.source_url ?? '' } }; });"
      }
    },
    {
      "id": "4ff69669-b3e1-554d-9101-e965aeca7e64",
      "name": "Append rows to sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": "={{ $('Set search').first().json.spreadsheetUrl }}"
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "={{ $('Set search').first().json.sheetTab }}"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": [
            {
              "id": "scraped_at",
              "displayName": "scraped_at",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "business",
              "displayName": "business",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "business_phone",
              "displayName": "business_phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "city",
              "displayName": "city",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "website",
              "displayName": "website",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "name",
              "displayName": "name",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "title",
              "displayName": "title",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "seniority",
              "displayName": "seniority",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "work_email",
              "displayName": "work_email",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "work_phone",
              "displayName": "work_phone",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "linkedin_url",
              "displayName": "linkedin_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            },
            {
              "id": "source_url",
              "displayName": "source_url",
              "required": false,
              "defaultMatch": false,
              "display": true,
              "type": "string",
              "canBeUsedToMatch": true
            }
          ]
        },
        "options": {}
      },
      "position": [
        1560,
        300
      ]
    }
  ],
  "connections": {
    "Every Monday at 08:00": {
      "main": [
        [
          {
            "node": "Set search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set search": {
      "main": [
        [
          {
            "node": "Run Google Maps Scraper",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Google Maps Scraper": {
      "main": [
        [
          {
            "node": "Collect websites",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Collect websites": {
      "main": [
        [
          {
            "node": "Run Decision Maker Finder",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Decision Maker Finder": {
      "main": [
        [
          {
            "node": "Join",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Join": {
      "main": [
        [
          {
            "node": "Append rows to sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "pinData": {},
  "tags": []
}
