Perplexity to Google Sheets, cleaner lead lists
Your lead sheet starts clean. Then you do “just a quick scrape,” paste results from a few sources, and suddenly you’re staring at duplicates, missing emails, and rows that don’t match. It’s messy, and it slows everything down.
Sales reps feel it when follow-ups bounce. A marketing manager building a local campaign feels it when lists need “one more pass.” And if you run an agency, you’ve probably rebuilt the same spreadsheet logic for three different clients. This Perplexity Sheets automation keeps your lead list usable without babysitting it.
You’ll see how the workflow finds local businesses, uses AI to turn messy text into structured rows, and appends only new leads into Google Sheets (so your outreach can actually move).
How This Automation Works
The full n8n workflow, from trigger to final output:
n8n Workflow Template: Perplexity to Google Sheets, cleaner lead lists
flowchart LR
subgraph sg0["Start Workflow Flow"]
direction LR
n0@{ icon: "mdi:brain", form: "rounded", label: "OpenAI Chat Model", pos: "b", h: 48 }
n1@{ icon: "mdi:robot", form: "rounded", label: "Structured Output Parser", pos: "b", h: 48 }
n2@{ icon: "mdi:play-circle", form: "rounded", label: "Start Workflow", pos: "b", h: 48 }
n3@{ icon: "mdi:swap-vertical", form: "rounded", label: "Set Location", pos: "b", h: 48 }
n4@{ icon: "mdi:database", form: "rounded", label: "Get Current Leads", pos: "b", h: 48 }
n5@{ icon: "mdi:cog", form: "rounded", label: "Combine Into One", pos: "b", h: 48 }
n6@{ icon: "mdi:swap-vertical", form: "rounded", label: "Set as text", pos: "b", h: 48 }
n7["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/perplexity.dark.svg' width='40' height='40' /></div><br/>Research Leads"]
n8@{ icon: "mdi:robot", form: "rounded", label: "Write JSON", pos: "b", h: 48 }
n9@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Companies", pos: "b", h: 48 }
n10@{ icon: "mdi:swap-vertical", form: "rounded", label: "Split Emails", pos: "b", h: 48 }
n11["<div style='background:#f5f5f5;padding:10px;border-radius:8px;display:inline-block;border:1px solid #e0e0e0'><img src='https://flowpast.com/wp-content/uploads/n8n-workflow-icons/merge.svg' width='40' height='40' /></div><br/>Merge Rows"]
n12@{ icon: "mdi:database", form: "rounded", label: "Send Leads to Google Sheets", pos: "b", h: 48 }
n11 --> n12
n8 --> n9
n8 --> n10
n6 --> n7
n3 --> n4
n10 --> n11
n7 --> n8
n2 --> n3
n9 --> n11
n5 --> n6
n4 --> n5
n0 -.-> n8
n1 -.-> n8
end
%% Styling
classDef trigger fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
classDef ai fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef aiModel fill:#e8eaf6,stroke:#3f51b5,stroke-width:2px
classDef decision fill:#fff8e1,stroke:#f9a825,stroke-width:2px
classDef database fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef api fill:#fff3e0,stroke:#e65100,stroke-width:2px
classDef code fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
classDef disabled stroke-dasharray: 5 5,opacity: 0.5
class n2 trigger
class n1,n8 ai
class n0 aiModel
class n4,n12 database
classDef customIcon fill:none,stroke:none
class n7,n11 customIcon
The Problem: Lead lists get dirty fast
Local prospecting sounds simple until you do it at scale. You search for “coffee shops in Hershey PA,” copy results into a sheet, and realize half the entries have no email. Then you find emails elsewhere, paste them in, and now the company name doesn’t match the email row anymore. After that comes deduping. Not just once, but every time you refresh the list. The real cost isn’t only time (though it’s usually a few hours a week). It’s the mental overhead and the quiet errors that wreck deliverability and make outreach feel random.
The friction compounds. Here’s where it usually breaks down.
- You end up copying raw results that look readable, but don’t turn into clean rows without manual editing.
- Duplicates creep in because you’re pulling from the same geography and keywords over and over.
- Company names and emails get misaligned, which leads to embarrassing personalization mistakes.
- Someone has to “clean the sheet” before outreach can even start.
The Solution: Perplexity research + OpenAI cleanup → Google Sheets
This n8n workflow automates the boring middle of lead generation: the part between “find businesses” and “start outreach.” You kick it off manually when you want fresh leads. First, it sets your target area (for example, Hershey PA), then pulls your current Google Sheet so it knows what you already have. Next, it queries Perplexity for a batch of local businesses while excluding anything already in your sheet. Perplexity’s response is useful, but it’s still unstructured text. That’s where OpenAI steps in, converting the output into consistent JSON arrays (company names and emails) that a spreadsheet can actually use. Finally, the workflow splits, lines up, merges each company with its email, and appends the clean rows to Google Sheets.
The workflow starts with a location you define and a quick “read” of your existing sheet. It then does research and cleanup in one pass, and ends by writing only the new, structured rows back into Google Sheets. No copy-paste, no “which email belongs to which business?” guessing.
What You Get: Automation vs. Results
| What This Workflow Automates | Results You’ll Get |
|---|---|
|
|
Example: What This Looks Like
Say you build a local list every Monday: 20 businesses, with a name and an email for each. Manually, research plus cleanup is often about 10 minutes per lead (find, verify, paste, format), which is roughly 3 hours for a batch of 20. With this workflow, you start the run, let Perplexity return the results, and OpenAI structures them for your sheet. You’ll usually spend a few minutes reviewing the new rows, not rebuilding them.
What You’ll Need
- n8n instance (try n8n Cloud free)
- Self-hosting option if you prefer (Hostinger works well)
- Google Sheets to store and dedupe lead rows
- Perplexity to research local businesses and emails
- OpenAI API key (get it from the OpenAI platform dashboard)
Skill level: Beginner. You will connect credentials, choose your spreadsheet, and edit the target location and prompt text.
Don’t want to set this up yourself? Talk to an automation expert (free 15-minute consultation).
How It Works
You trigger it when you want new leads. This workflow uses a manual start, which is perfect for weekly prospecting runs or “I need 20 more businesses in this city” moments.
Your target area gets set. A simple field defines the location (like Hershey PA), so the rest of the workflow stays consistent even when you switch towns, counties, or regions.
Your existing sheet is used as a guardrail. n8n pulls your current Google Sheets leads, aggregates them, and prepares a “do not include” context so Perplexity doesn’t return the same businesses again.
Perplexity researches, then OpenAI structures. Perplexity returns a text-heavy answer, then the OpenAI Chat Model/AI Agent converts it into clean JSON that can be split into a company list and an email list. Those lists get merged into row-ready records.
Clean rows land in Google Sheets. The final Google Sheets node updates or appends new leads, so your list grows without turning into a duplicate swamp.
You can easily modify the search area to target a different city, or adjust the fields to capture phone numbers and websites based on your needs. See the full implementation guide below for customization options.
Step-by-Step Implementation Guide
Step 1: Configure the Manual Trigger
Start the workflow with a manual run so you can test the lead research process end-to-end.
- Add and keep Manual Execution Start as the trigger node.
- Leave Manual Execution Start with default settings (no parameters required).
- (Optional) Keep Flowpast Branding as a visual note for documentation only.
Step 2: Connect Google Sheets
Configure the input and output Sheets nodes that load existing leads and update your spreadsheet.
- Open Retrieve Existing Leads and set the Document to your Google Sheet (example value:
[YOUR_ID]) and Sheet toSheet1(gid=0). - In Retrieve Existing Leads, add a filter for Area with Lookup Value set to
{{ $json.Area }}. - Credential Required: Connect your googleSheetsOAuth2Api credentials in Retrieve Existing Leads.
- Open Update Leads Spreadsheet and set Operation to
appendOrUpdate. - In Update Leads Spreadsheet → Columns, map fields to: Area =
{{ $('Map Text Fields').item.json['Search Area'] }}, Email ={{ $json['output.Email'] }}, Company ={{ $json['output.Company'] }}. - Set Matching Columns to
Emailto avoid duplicates by email. - Credential Required: Connect your googleSheetsOAuth2Api credentials in Update Leads Spreadsheet.
Step 3: Set Up Lead Context and Aggregation
Define the target area and prepare existing lead data before sending it to AI research.
- Open Assign Area Value and set Area to
Hershey PA(change this to your desired search area). - Confirm Retrieve Existing Leads connects to Aggregate Items to consolidate existing records.
- Open Aggregate Items and keep Aggregate set to
aggregateAllItemData. - Open Map Text Fields and set Search Area to
{{ $('Assign Area Value').item.json.Area }}and data to{{ $json.data }}.
Step 4: Set Up AI Research and Structured Parsing
Run the research query and convert the AI response into a structured JSON format.
- Open Discover New Leads and confirm Model is set to
sonarwith Simplify enabled. - In Discover New Leads → Messages, keep the system prompt and set the user content to
Area: {{ $json['Search Area'] }} Already Scraped: {{ $json.data }}. - Credential Required: Connect your perplexityApi credentials in Discover New Leads.
- Open Generate JSON Format and set Text to
{{ $json.message }}. - In Generate JSON Format → System Message, keep the JSON schema instructions to output
{ "Company": [...], "Email": [...] }. - Ensure OpenAI Chat Engine is connected as the language model for Generate JSON Format. Credential Required: Connect your openAiApi credentials in OpenAI Chat Engine.
- Ensure Structured Output Reader is connected as the output parser for Generate JSON Format. Add parser credentials to OpenAI Chat Engine if required (do not add them to Structured Output Reader).
Step 5: Split, Merge, and Prepare Records for Update
Break the JSON arrays into individual rows and combine email/company pairs for spreadsheet updates.
- Open Split Company List and set Field to Split Out to
output.Company. - Open Split Email List and set Field to Split Out to
output.Email. - Generate JSON Format outputs to both Split Company List and Split Email List in parallel.
- Open Merge Records and set Mode to
combinewith Combine By set tocombineByPosition.
Step 6: Test and Activate Your Workflow
Validate the workflow manually, then activate it for repeated use.
- Click Execute Workflow to run Manual Execution Start and follow the data through each node.
- Verify that Update Leads Spreadsheet appends or updates rows with Area, Email, and Company values.
- If results are missing, confirm the Retrieve Existing Leads filter is using
{{ $json.Area }}and that Map Text Fields outputs a valid Search Area. - Once verified, toggle the workflow to Active for production use.
Common Gotchas
- Google Sheets credentials can expire or need specific permissions. If things break, check n8n → Credentials and confirm the connected Google account still has access to the spreadsheet.
- If you’re using Wait nodes or external rendering, processing times vary. Bump up the wait duration if downstream nodes fail on empty responses.
- Default prompts in AI nodes are generic. Add your brand voice early or you’ll be editing outputs forever.
Frequently Asked Questions
About 30 minutes if your accounts are ready.
No. You’ll mostly connect credentials and edit a couple of text fields (location and the research prompt).
Yes. n8n has a free self-hosted option and a free trial on n8n Cloud. Cloud plans start at $20/month for higher volume. You’ll also need to factor in OpenAI and Perplexity API usage, which typically costs a few dollars for small weekly batches.
Two options: n8n Cloud (managed, easiest setup) or self-hosting on a VPS. For self-hosting, Hostinger VPS is affordable and handles n8n well. Self-hosting gives you unlimited executions but requires basic server management.
Yes, but you’ll want to do it in two places. Update the Perplexity prompt in the “Discover New Leads” step so it returns the extra fields, then adjust the OpenAI “Generate JSON Format” step to output those fields in the structured JSON. After that, add new columns to your Google Sheet and map them in the final Google Sheets write node. It’s straightforward once you see one successful run.
Usually it’s expired OAuth access or the Google account lost permission to the spreadsheet. Reconnect the Google Sheets (OAuth2) credential in n8n, then open the Google Sheets nodes and re-select the correct spreadsheet and worksheet. If it still fails, check that the sheet wasn’t moved to a different Drive or locked down by an admin.
Practically, it’s fine for dozens to a few hundred leads per run.
For this exact job, n8n is usually the more comfortable fit because the workflow has branching, merging, and structured parsing that gets awkward (and pricey) in simpler automation tools. The AI Agent and structured output approach is also easier to control in n8n, which matters when you care about clean rows. Zapier or Make can still work if you keep it basic, but you’ll often end up with more “glue steps” and manual cleanup. Frankly, that defeats the point. Talk to an automation expert if you want help choosing.
Clean lead lists are an unfair advantage, honestly. Set this up once, run it when you need new prospects, and spend your time on outreach that actually gets replies.
Need Help Setting This Up?
Our automation experts can build and customize this workflow for your specific needs. Free 15-minute consultation—no commitment required.