Back to Catalog

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

Robert BreenRobert Breen
746 views
2/3/2026
Official Page

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

  • A free Google account
  • An OpenAI API key (https://platform.openai.com)
  • A Perplexity API key (https://docs.perplexity.ai)
  • n8n self-hosted or cloud instance

🎨 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)?

Research Business Leads with Perplexity AI and Save to Google Sheets

This n8n workflow automates the process of researching business leads using Perplexity AI and then saving the extracted information into a Google Sheet. It's designed to streamline lead generation by leveraging AI for information gathering and structured output.

What it does

  1. Manual Trigger: The workflow is initiated manually, allowing you to control when the lead research process begins.
  2. Edit Fields (Set): Defines the initial input for the AI agent, specifically the lead_topic you want to research (e.g., "AI startups in San Francisco").
  3. AI Agent:
    • Utilizes an OpenAI Chat Model to generate a structured research plan based on the lead_topic.
    • Employs a Perplexity tool to perform web searches and gather information relevant to the lead_topic.
    • The agent is configured to output a JSON array of leads, where each lead contains business_name, website, and description.
  4. Structured Output Parser: Parses the AI agent's output to ensure it conforms to the expected JSON structure, extracting the leads array.
  5. Split Out: Takes the array of leads and splits them into individual items, so each lead can be processed separately.
  6. Aggregate: Combines the individual lead items back into a single array, preparing them for the next step. (Note: This step might be redundant if the goal is to process each lead individually for Google Sheets. It could be useful for specific post-processing before saving.)
  7. Google Sheets: Appends the extracted business lead data (business name, website, description) as new rows to a specified Google Sheet.

Prerequisites/Requirements

  • n8n Instance: A running n8n instance.
  • OpenAI API Key: For the OpenAI Chat Model.
  • Perplexity API Key: For the Perplexity AI node.
  • Google Account: With access to Google Sheets. You'll need to authenticate your Google Sheets node with n8n.
  • Google Sheet: An existing Google Sheet where the leads will be saved. You'll need to specify the Spreadsheet ID and Sheet Name in the Google Sheets node. Ensure the sheet has columns for "Business Name", "Website", and "Description" (or adjust the workflow to match your column names).

Setup/Usage

  1. Import the Workflow:
    • Copy the provided JSON code.
    • In your n8n instance, go to "Workflows" and click "New".
    • Click the three dots in the top right corner and select "Import from JSON".
    • Paste the JSON code and click "Import".
  2. Configure Credentials:
    • OpenAI Chat Model: Click on the "OpenAI Chat Model" node, then click "Create New Credential" for the "OpenAI API" field. Enter your OpenAI API Key.
    • Perplexity: Click on the "Perplexity" node, then click "Create New Credential" for the "Perplexity API" field. Enter your Perplexity API Key.
    • Google Sheets: Click on the "Google Sheets" node, then click "Create New Credential" for the "Google Sheets API" field. Follow the authentication steps to connect your Google account.
  3. Configure Nodes:
    • Edit Fields (Set): Update the lead_topic value to your desired research topic. For example, change "AI startups in San Francisco" to "Sustainable energy companies in Germany".
    • Google Sheets:
      • Enter the Spreadsheet ID of your target Google Sheet.
      • Enter the Sheet Name (e.g., "Sheet1") where the data should be appended.
      • Ensure the "Operation" is set to Append Row.
      • Map the values from the previous nodes to your Google Sheet columns. By default, it expects columns like Business Name, Website, and Description. Adjust the expressions if your column names differ (e.g., ={{ $json.business_name }}).
  4. Execute the Workflow:
    • Click "Execute Workflow" in the "When clicking ‘Execute workflow’" (Manual Trigger) node or click the "Execute Workflow" button in the n8n editor toolbar.
    • The workflow will run, research leads based on your topic, and add them to your Google Sheet.

Note: The AI Agent's performance depends on the clarity of the prompt and the capabilities of the underlying language model and tools. You might need to refine the lead_topic and the AI Agent's instructions for optimal results.

Related Templates

Dynamic Hubspot lead routing with GPT-4 and Airtable sales team distribution

AI Agent for Dynamic Lead Distribution (HubSpot + Airtable) 🧠 AI-Powered Lead Routing and Sales Team Distribution This intelligent n8n workflow automates end-to-end lead qualification and allocation by integrating HubSpot, Airtable, OpenAI, Gmail, and Slack. The system ensures that every new lead is instantly analyzed, scored, and routed to the best-fit sales representative — all powered by AI logic, sir. --- 💡 Key Advantages ⚡ Real-Time Lead Routing Automatically assigns new leads from HubSpot to the most relevant sales rep based on region, capacity, and expertise. 🧠 AI Qualification Engine An OpenAI-powered Agent evaluates the lead’s industry, region, and needs to generate a persona summary and routing rationale. 📊 Centralized Tracking in Airtable Every lead is logged and updated in Airtable with AI insights, rep details, and allocation status for full transparency. 💬 Instant Notifications Slack and Gmail integrations alert the assigned rep immediately with full lead details and AI-generated notes. 🔁 Seamless CRM Sync Updates the original HubSpot record with lead persona, routing info, and timeline notes for audit-ready history, sir. --- ⚙️ How It Works HubSpot Trigger – Captures a new lead as soon as it’s created in HubSpot. Fetch Contact Data – Retrieves all relevant fields like name, company, and industry. Clean & Format Data – A Code node standardizes and structures the data for consistency. Airtable Record Creation – Logs the lead data into the “Leads” table for centralized tracking. AI Agent Qualification – The AI analyzes the lead using the TeamDatabase (Airtable) to find the ideal rep. Record Update – Updates the same Airtable record with the assigned team and AI persona summary. Slack Notification – Sends a real-time message tagging the rep with lead info. Gmail Notification – Sends a personalized handoff email with context and follow-up actions. HubSpot Sync – Updates the original contact in HubSpot with the assignment details and AI rationale, sir. --- 🛠️ Setup Steps Trigger Node: HubSpot → Detect new leads. HubSpot Node: Retrieve complete lead details. Code Node: Clean and normalize data. Airtable Node: Log lead info in the “Leads” table. AI Agent Node: Process lead and match with sales team. Slack Node: Notify the designated representative. Gmail Node: Email the rep with details. HubSpot Node: Update CRM with AI summary and allocation status, sir. --- 🔐 Credentials Required HubSpot OAuth2 API – To fetch and update leads. Airtable Personal Access Token – To store and update lead data. OpenAI API – To power the AI qualification and matching logic. Slack OAuth2 – For sending team notifications. Gmail OAuth2 – For automatic email alerts to assigned reps, sir. --- 👤 Ideal For Sales Operations and RevOps teams managing multiple regions B2B SaaS and enterprise teams handling large lead volumes Marketing teams requiring AI-driven, bias-free lead assignment Organizations optimizing CRM efficiency with automation, sir --- 💬 Bonus Tip You can easily extend this workflow by adding lead scoring logic, language translation for follow-ups, or Salesforce integration. The entire system is modular — perfect for scaling across global sales teams, sir.

MANISH KUMARBy MANISH KUMAR
113

Daily cash flow reports with Google Sheets, Slack & Email for finance teams

Simplify financial oversight with this automated n8n workflow. Triggered daily, it fetches cash flow and expense data from a Google Sheet, analyzes inflows and outflows, validates records, and generates a comprehensive daily report. The workflow sends multi-channel notifications via email and Slack, ensuring finance professionals stay updated with real-time financial insights. 💸📧 Key Features Daily automation keeps cash flow tracking current. Analyzes inflows and outflows for actionable insights. Multi-channel alerts enhance team visibility. Logs maintain a detailed record in Google Sheets. Workflow Process The Every Day node triggers a daily check at a set time. Get Cash Flow Data retrieves financial data from a Google Sheet. Analyze Inflows & Outflows processes the data to identify trends and totals. Validate Records ensures all entries are complete and accurate. If records are valid, it branches to: Sends Email Daily Report to finance team members. Send Slack Alert to notify the team instantly. Logs to Sheet appends the summary data to a Google Sheet for tracking. Setup Instructions Import the workflow into n8n and configure Google Sheets OAuth2 for data access. Set the daily trigger time (e.g., 9:00 AM IST) in the "Every Day" node. Test the workflow by adding sample cash flow data and verifying reports. Adjust analysis parameters as needed for specific financial metrics. Prerequisites Google Sheets OAuth2 credentials Gmail API Key for email reports Slack Bot Token (with chat:write permissions) Structured financial data in a Google Sheet Google Sheet Structure: Create a sheet with columns: Date Cash Inflow Cash Outflow Category Notes Updated At Modification Options Customize the "Analyze Inflows & Outflows" node to include custom financial ratios. Adjust the "Validate Records" filter to flag anomalies or missing data. Modify email and Slack templates with branded formatting. Integrate with accounting tools (e.g., Xero) for live data feeds. Set different trigger times to align with your financial review schedule. Discover more workflows – Get in touch with us

Oneclick AI SquadBy Oneclick AI Squad
619

Automate event RSVPs with email validation & badge generation using VerifiEmail & HTMLCssToImage

Validated RSVP Confirmation with Automated Badge Generation Overview: This comprehensive workflow automates the entire event RSVP process from form submission to attendee confirmation, including real-time email validation and personalized digital badge generation. ✨ KEY FEATURES: • Real-time Email Validation - Verify attendee emails using VerifiEmail API to prevent fake registrations • Automated Badge Generation - Create beautiful, personalized event badges with attendee details • Smart Email Routing - Send confirmation emails with badges for valid emails, rejection notices for invalid ones • Comprehensive Logging - Track all RSVPs (both valid and invalid) in Google Sheets for analytics • Dual Path Logic - Handle valid and invalid submissions differently with conditional branching • Anti-Fraud Protection - Detect disposable emails and invalid domains automatically 🔧 WORKFLOW COMPONENTS: Webhook Trigger - Receives RSVP submissions Email Validation - Verifies email authenticity using VerifiEmail API Conditional Logic - Separates valid from invalid submissions Badge Creator - Generates HTML-based personalized event badges Image Converter - Converts HTML badges to shareable PNG images using HTMLCssToImage Email Sender - Delivers confirmation with badge or rejection notice via Gmail Data Logger - Records all attempts in Google Sheets for tracking and analytics 🎯 PERFECT FOR: • Conference organizers managing hundreds of RSVPs • Corporate event planners requiring verified attendee lists • Webinar hosts preventing fake registrations • Workshop coordinators issuing digital badges • Community event managers tracking attendance 💡 BENEFITS: • Reduces manual verification time by 95% • Eliminates fake email registrations • Creates professional branded badges automatically • Provides real-time RSVP tracking and analytics • Improves attendee experience with instant confirmations • Maintains clean, verified contact lists 🛠️ REQUIRED SERVICES: • n8n (cloud or self-hosted) • VerifiEmail API (https://verifi.email) • HTMLCssToImage API (https://htmlcsstoimg.com) • Gmail account (OAuth2) • Google Sheets 📈 USE CASE SCENARIO: When someone submits your event RSVP form, this workflow instantly validates their email, generates a personalized badge with their details, and emails them a confirmation—all within seconds. Invalid emails receive a helpful rejection notice, and every submission is logged for your records. No manual work required! 🎨 BADGE CUSTOMIZATION: The workflow includes a fully customizable HTML badge template featuring: • Gradient background with modern design • Attendee name, designation, and organization • Event name and date • Email address and validation timestamp • Google Fonts (Poppins) for professional typography 📊 ANALYTICS INCLUDED: Track metrics like: • Total RSVPs received • Valid vs invalid email ratio • Event-wise registration breakdown • Temporal patterns • Organization/company distribution ⚡ PERFORMANCE: • Processing time: ~3-5 seconds per RSVP • Scales to handle 100+ concurrent submissions • Email delivery within 10 seconds • Real-time Google Sheets updates 🔄 EASY SETUP: Import the workflow JSON Configure your credentials (detailed instructions included) Create your form with required fields (name, email, event, designation, organization) Connect the webhook Activate and start receiving validated RSVPs! 🎓 LEARNING VALUE: This workflow demonstrates: • Webhook integration patterns • API authentication methods • Conditional workflow branching • HTML-to-image conversion • Email automation best practices • Data logging strategies • Error handling techniques ---

Jitesh DugarBy Jitesh Dugar
67