Automate Lead Qualification in Google Sheets with GPT-4 & n8n

This workflow automates lead qualification by integrating Google Sheets with OpenAI’s GPT-4 via n8n. It speeds up lead vetting by automatically rating leads based on decision-making authority and email domain, reducing manual workload and improving accuracy.
googleSheetsTrigger
openAi
set
+3
Workflow Identifier: 2262
NODES in Use: Google Sheets Trigger, OpenAI, Set, Merge, Google Sheets, Sticky Note

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What This Workflow Does

This workflow watches a Google Sheet for new leads added from Google Forms submissions.
It sends lead data like name, email, business area, and team size to GPT-4 to check if the lead is a good fit.
The workflow updates the Google Sheet with a rating that shows if the lead is qualified or not.
This saves time by automating lead qualification and helps quickly find good leads.


Tools and Services Used

  • Google Sheets: Stores incoming lead data from forms.
  • Google Sheets Trigger node in n8n: Detects when new rows appear.
  • OpenAI GPT-4 API: Analyzes lead details to decide qualification.
  • n8n Workflow Automation Platform: Runs the logic connecting Sheets and OpenAI.

Inputs, Processing Steps, and Outputs

Inputs

  • New rows in the specified Google Sheet tab with lead details: name, email, business area, team size, and timestamp.

Processing Steps

  • Google Sheets Trigger fires on new row added.
  • Lead info is sent to OpenAI node running GPT-4, with a prompt asking if the lead is a decision-maker with team size or corporate email.
  • Response is a JSON string with rating “qualified” or “not qualified” plus explanation.
  • Set node parses the GPT JSON reply into fields.
  • Merge node combines original lead data with the parsed GPT output.
  • Google Sheets node updates the same row with the qualification rating.

Output

  • The Google Sheet row gets updated near the lead info with the qualification result.
  • This helps quickly see which leads are good to contact and which are not.

Beginner Step-by-Step: How to Use This Workflow in n8n Production

Importing the Workflow

  1. Download the workflow file using the Download button on this page.
  2. Open the n8n editor where the workflow automations are done.
  3. Choose “Import from File” in n8n and select the downloaded workflow file.

Setup Configuration

  1. After import, add or update Google Sheets OAuth2 credentials in the Google Sheets Trigger and Google Sheets nodes.
  2. Enter your OpenAI API Key in the OpenAI node.
  3. If needed, update the Google Sheet document ID and sheet tab name to match your own sheet.
  4. Confirm the timestamp column name or any matching ID used to update rows.
  5. Review the OpenAI prompt in the OpenAI node, you can copy/paste or edit it below if needed.
Your task is to qualify incoming leads. Leads are form submissions to a closed community group. Use the following criteria for a quality lead:
1. We are looking for decision makers who run companies or who have some teams. The bigger the team - the better. Everyone with responsibility is accepted.
2. Email from a non-standard domain (preferably corporate).

If either criterion matches, reply with "qualified"; otherwise "not qualified". Reply only with JSON {"rating":"string","explanation":"string"}.

Test and Activate

  1. Run a test lead submission through your Google Form or add a row with test data in the sheet.
  2. Check if the workflow triggers and updates the row with “qualified” or “not qualified”.
  3. If it works as expected, activate the workflow to run automatically.

For users hosting n8n themselves, see self-host n8n for tips on maintaining credentials and access.


Customization Ideas

  • You can change the OpenAI system prompt to fit special rules for your community’s lead quality.
  • Update the Google Sheets node to add an explanation column to record why a lead got a rating.
  • Adjust the polling interval in the Google Sheets Trigger if you want faster or slower checks.
  • If simple text is better, change the prompt to give plain strings instead of JSON.

Troubleshooting Common Issues

Google Sheets Nodes Show “Invalid Credentials”

This usually means the OAuth permission expired or was denied.
Solution: Reauthorize your Google account credentials inside n8n.

OpenAI Response Can’t Be Parsed as JSON

This means the prompt might not be clear, or the API failed.
Solution: Double-check the formatting of the system and user messages to ensure GPT replies with strict JSON. Try the prompt in the OpenAI playground first.

Data Doesn’t Match After Merge Node

This happens if the merge mode or input order is wrong.
Solution: Use “combine” mode and “mergeByPosition” in the Merge node. Ensure the Google Sheets trigger output is the first input.


Pre-Production Checklist

  • Confirm Google Sheet document ID and sheet name exactly match the nodes.
  • Test the OpenAI prompt separately to see valid JSON results.
  • Make sure the timestamp or ID column values are unique to avoid wrong row updates.
  • Try submitting test leads and watching workflow logs for errors.
  • Save a backup copy of the Google Sheet before enabling automatic updates.

Deployment Guide

Once tested, activate the workflow by toggling on in n8n.
Keep an eye on executions to catch any failures or mistakes.
If running self-host n8n, make sure internet access and credential storage are handled securely.


Summary of What You Get

✓ Automated lead qualification based on clear business rules.
✓ Faster processing of form submissions without manual effort.
✓ Lead ratings written back into Google Sheets for easy use.
✓ Reduced human errors from sorting through many rows.
✓ Ready-to-run n8n workflow that fits most Google Sheets and OpenAI setups.


Frequently Asked Questions

The Google Sheets Trigger node watches for new rows added to the sheet and starts the workflow each time a new lead is submitted.
The OpenAI GPT-4 node must return a JSON string with two fields: “rating” and “explanation” for proper parsing and sheet updating.
The workflow uses a Google Sheets node set to update the row matching the unique timestamp, inserting the qualification rating and explanation.
Yes, the workflow can process hundreds of leads daily, but very high volumes may need adjusted trigger polling and API rate limits.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free