Skip to main content

Research business leads with Perplexity AI & save to Google Sheets using OpenAI

Workflow preview

Workflow preview
100%
Research business leads with Perplexity AI & save to Google Sheets using OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Automatically research new leads in your target area, structure the results with AI, and append them into Google Sheets — all orchestrated in n8n. What this template does Uses Perplexity to resea...

Best for

  • Lead Generation automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.stickynote, n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.googlesheets, n8n-nodes-base.aggregate, n8n-nodes-base.perplexity

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Robert Breen.

Original n8n.io source

1.1 Workflow description

Title
Research business leads with Perplexity AI & save to Google Sheets using OpenAI
Workflow name
Research business leads with Perplexity AI & save to Google Sheets using OpenAI

Automatically research new leads in your target area, structure the results with AI, and append them into Google Sheets — all orchestrated in n8n.


✅ What this template does

  • Uses Perplexity to research businesses (coffee shops in this example) with company name + email
  • Cleans and structures the output into proper JSON using OpenAI
  • Appends the new leads directly into Google Sheets, skipping duplicates

> Trigger: Manual — “Start Workflow”


👤 Who’s it for

  • Sales & marketing teams who need to prospect local businesses
  • Agencies running outreach campaigns
  • Freelancers and consultants looking to automate lead research

⚙️ How it works

  1. Set Location → define your target area (e.g., Hershey PA)
  2. Get Current Leads → pull existing data from your Google Sheet to avoid duplicates
  3. Research Leads → query Perplexity for 20 businesses, excluding already-scraped ones
  4. Write JSON → OpenAI converts Perplexity output into structured Company/Email arrays
  5. Split & Merge → align Companies with Emails row-by-row
  6. Send Leads to Google Sheets → append or update leads in your sheet

🛠️ Setup instructions

Follow these sticky-note setup steps (already included in the workflow):

1) Connect Google Sheets (OAuth2)

  1. In n8n → Credentials → New → Google Sheets (OAuth2)
  2. Sign in with your Google account and grant access
  3. In the Google Sheets node, select your Spreadsheet and Worksheet

Example sheet:
https://docs.google.com/spreadsheets/d/1MnaU8hSi8PleDNVcNnyJ5CgmDYJSUTsr7X5HIwa-MLk/edit#gid=0


2) Connect Perplexity (API Key)

  1. Sign in at https://www.perplexity.ai/account
  2. Generate an API key: https://docs.perplexity.ai/guides/getting-started
  3. In n8n → Credentials → New → Perplexity API, paste your key

3) Connect OpenAI (API Key)

  1. In n8n → Credentials → New → OpenAI API
  2. Paste your OpenAI API key
  3. In the OpenAI Chat Model node, select your credential and a vision-capable model (e.g., gpt-4o-mini, gpt-4o)

🔧 Requirements


🎨 How to customize

  • Change the Search Area in the Set Location node
  • Modify the Perplexity system prompt to target different business types (e.g., gyms, salons, restaurants)
  • Expand the Google Sheet schema to include more fields (phone, website, etc.)

📬 Contact

Need help customizing this (e.g., filtering by campaign, sending reports by email, or formatting your Google Sheet)?

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 2 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 3 - Sticky Note59

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 4 - Sticky Note8

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 5 - Sticky Note71

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 6 - Sticky Note72

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 7 - Sticky Note69

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 8 - Start Workflow

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 9 - Set Location

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Get Current Leads

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 11 - Combine Into One

Type / Role
n8n-nodes-base.aggregate - aggregate
Config choices
Version 1

Block 12 - Set as text

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 13 - Research Leads

Type / Role
n8n-nodes-base.perplexity - perplexity
Config choices
Version 1

Block 14 - Write JSON

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 15 - Split Companies

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 16 - Split Emails

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 17 - Merge Rows

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 18 - Send Leads to Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

3. Summary Table

Workflow Research business leads with Perplexity AI & save to Google Sheets using OpenAI
Complexity advanced
Nodes 18
Categories Lead Generation, AI RAG
Author Robert Breen
Published 03 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8229/8229.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Research business leads with Perplexity AI & save to Google Sheets using OpenAI do?

Automatically research new leads in your target area, structure the results with AI, and append them into Google Sheets — all orchestrated in n8n. What this template does Uses Perplexity to resea...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Lead Generation, AI RAG use case.