Daily local lead list builder from Google Maps to Google Sheets

By General Input

Every weekday at 6am, pull fresh local businesses with emails and socials for every target city, dedupe against your existing list, and append the new ones to a Google Sheet.

Integrations

  • Local Business Data
  • Google Sheets

Type

Deterministic Code

Categories

  • Sales
  • Operations

Build me a code workflow that grows a Google Sheet of fresh local business leads every weekday morning. The trigger is a cron schedule: every weekday at 6am in my local timezone.

Inputs the workflow should accept up front: the Google Sheets spreadsheet ID, the name of the config tab (default Targets), and the name of the leads tab (default Leads).

Step 1. Call Google Sheets Get Values on the config tab to read my target rows. Each row has three columns: business_type, city_or_area, country_code (ISO 3166-1 alpha-2, default us). Skip the header row and any empty rows.

Step 2. Call Google Sheets Get Values on the leads tab to read the business_id column. Build an in-memory set of business IDs already collected so we can dedupe against everything ever harvested.

Step 3. For each target row, call Local Business Data Search with query set to the business_type plus the city_or_area (for example: 'plumbers in Austin, TX'), region set to country_code, extract_emails_and_contacts set to true, and limit set to 100. This returns up to 100 businesses with email and social profile fields populated where available.

Step 4. Collect every returned business across all target rows. Drop any business whose business_id is in the dedupe set. Also dedupe within the current run, in case two target rows surface the same business.

Step 5. Call Google Sheets Append Values on the leads tab to append one row per new business, with valueInputOption USER_ENTERED. Columns in order: business_id, name, full_address, phone_number, email, website, rating, review_count, linkedin, instagram, facebook, query_used, harvested_at. query_used is the search query we sent for that row. harvested_at is the current ISO 8601 timestamp.

If a target row returns no results, log it and continue to the next row, do not fail the whole run. If the leads tab is empty (first ever run), treat the dedupe set as empty and append everything.

No AI judgement is needed at any step. This is a deterministic search, dedupe, and append pipeline.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seatsBuild audience segments from product usage and push to LoopsTurn the people who engage with your posts into Pipedrive leads