Back to Templates

Automate business lead scraping from Apify to Google Sheets with data cleaning

Created by

Created by: David Olusola || dae221
David Olusola

Last update

Last update 3 months ago

Categories

Share


๐Ÿš€ Automated Lead Scraper Workflow (Apify + n8n + Google Sheets)

๐Ÿง  What It Does

This n8n workflow automates the process of scraping leads using Apify, cleaning the extracted data, and exporting it to Google Sheetsโ€”ready for use in outreach, prospecting, or CRM pipelines.


๐Ÿ”„ Workflow Steps

  1. โœ… Start โ€“ Manually triggers the workflow.

  2. ๐Ÿงฉ Set Variables โ€“ Stores required Apify credentials:

    • APIFY_TOKEN: Your Apify token.
    • APIFY_TASK_ID: The Apify task to run.
  3. ๐Ÿ•ธ๏ธ Run Apify Scraper โ€“ Launches the scraper and fetches the dataset.

  4. ๐Ÿงน Clean Data โ€“ Processes scraped results to:

    • โœ‚๏ธ Strip non-numeric characters from phone numbers.
    • โœ‰๏ธ Format emails (lowercase + trimmed).
  5. ๐Ÿ“Š Export to Google Sheets โ€“ Appends clean data to your spreadsheet:

    • ๐Ÿข company name โ†’ from title
    • ๐Ÿ“ž phone โ†’ cleaned number
    • ๐Ÿ“ address โ†’ from scraped info

๐Ÿ› ๏ธ Requirements

  • ๐Ÿ•ท๏ธ Apify Account

    • A valid APIFY_TOKEN
    • An existing Apify task (APIFY_TASK_ID)
  • ๐Ÿ“— Google Sheets Access

    • OAuth2 credentials set up in n8n (e.g., "Google Sheets account 2")

๐Ÿšฆ How to Use

  1. โš™๏ธ Open the Variables node and plug in your Apify credentials.
  2. ๐Ÿ“„ Confirm the Google Sheets node points to your desired spreadsheet.
  3. โ–ถ๏ธ Run the workflow manually from the Start node.

๐Ÿ“ฅ Output

A ready-to-use sheet of cleaned lead data containing:

  • Company names
  • Phone numbers
  • Addresses

๐Ÿ’ผ Perfect For:

  • Sales teams doing outbound prospecting
  • Marketers building lead lists
  • Agencies running data aggregation tasks