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
Automate lead qualification with n8n and GPT-4

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

Learn how to Build this Workflow with AI:

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.


Automate lead qualification with n8n and GPT-4

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.