n8n workflow · Chapter 4 of 5
Lead Scraper for Editors
Updated · Tested on n8n 1.x · Part of the n8n Video Editor ebook
Text your bot "30 marketing agencies in Pune" and it finds businesses on Google Maps, scores them with AI and saves the best leads to your sheet.

How this n8n workflow works
- 1You send a request to the Telegram bot
- 2AI turns it into search details
- 3Apify scrapes matching businesses from Google Maps
- 4Duplicates and leads without email are removed
- 5AI scores each lead; good ones are saved
Who this workflow is for
Why it matters: editors and agencies doing outbound. The businesses that most need editing — marketing/digital agencies, coaches, real-estate firms, gyms, YouTubers — are all on Google Maps with public emails. This fills the top of your sales funnel in minutes, pre-qualified and scored, so Chapter 5 can email them automatically.
Inside the workflow: node by node
Every one of these nodes is explained in the ebook, with each setting, prompt and expression printed so you can copy it.
- 1. Telegram Command In
- 2. Parse Lead Command (AI Agent)
- 3. Command Parser Model
- 4. Command Output Parser
- 5. Normalize Command
- 6. Call Apify Google Maps
- 7. Read Existing Maps Emails
- 8. Process Maps Results
- 9. Build Apify Fail Alert
- 10. Send Apify Fail Alert
- 11. Loop Maps Leads
- 12. Build Maps Confirm
- 13. Send Maps Confirm
- 14. Score Maps Lead (AI Agent)
- 15. Maps Score Model
- 16. Maps Score Parser
- 17. Attach Maps Score
- 18. Keep Maps Score
- 19. Prepare Maps Sheet Row
- 20. Save Maps Lead
Before you start
- An n8n account.
- A Telegram bot + your chat ID.
- An Apify account + API token (free tier works to start).
- An OpenAI API key (gpt-4o-mini, for the two AI Agents).
- A Google Sheet (your leads sheet) + Google Sheets credential.
Quick setup guide
- 1Credentials: Connect Telegram, OpenAI, Google Sheets. Get your Apify token and paste it into the Call Apify Google Maps URL (replace YOURAPIFYTOKEN).
- 2IDs: Set YOURCHATID on the three Telegram nodes and YOURSHEETID on both Google Sheets nodes. Point the sheet/tab name at your own leads tab.
- 3Test: Message 20 marketing agencies in Pune → confirm you get a "✅ N naye leads mile" message and the rows appear in your sheet with Status = New.
- 4Check scoring: Confirm only leads scoring ≥ 6 were saved, each with a ScoreReason and OutreachAngle.
What success looks like: You text one line and minutes later your sheet is filled with pre-qualified, scored, ready-to-email clients who actually need an editor.
Common problems and fixes
Apify-fail alert
Why: Bad token / out of Apify credits
Fix: Paste a valid YOURAPIFYTOKEN; check Apify usage
No leads saved
Why: All scored < 6, or no emails found
Fix: Try a broader category/city; lower the >= 6 threshold
Duplicates appear
Why: Email column name mismatch
Fix: Ensure your sheet's email column is named Email
Phone becomes a formula
Why: Leading +
Fix: The textSafe function already handles this — keep it
Agent returns bad JSON
Why: Model/parser mismatch
Fix: Keep the Output Parser wired and gpt-4o-mini selected
Setup time
- With Claude Code30–45 minutes
Give the ebook to Claude Code and it builds the workflow for you.
- Import the JSON yourselfAbout 2 hours
Import the ready workflow JSON and connect your accounts.
- Build it by reading the ebookAbout 1 day
Follow every node and setting step by step to learn it fully.
Get this workflow
- Ready-to-import n8n workflow JSON
- Step-by-step PDF: every node and setting explained
- Copy-paste prompts and expressions — no coding
Frequently asked questions
Will this work on free n8n?
Yes. n8n itself can be free (the self-hosted Community edition) or you can use n8n Cloud. The workflow runs on both. You only pay for the outside services it uses, such as AI tokens, and many of them have free tiers to start.
How do I get the API keys (WhatsApp, OpenAI and others)?
The ebook includes a setup video for every API and account this workflow needs, so you can get each key step by step without any coding.
Do I need to know coding?
No. Every node, setting, prompt and expression is printed in the ebook, ready to copy-paste, and the workflow JSON can be imported in one click.
Can I use this Editors workflow for my clients?
Yes. Once it works for you, you can set it up for your own business or for clients and charge for the setup.
Apify-fail alert: how do I fix it?
Bad token / out of Apify credits. Fix: Paste a valid YOURAPIFYTOKEN; check Apify usage.
No leads saved: how do I fix it?
All scored < 6, or no emails found. Fix: Try a broader category/city; lower the >= 6 threshold.
Duplicates appear: how do I fix it?
Email column name mismatch. Fix: Ensure your sheet's email column is named Email.