See llms.txt for all machine-readable content.

Back to Templates

Qualify website leads with OpenAI and log replies in Gmail and Sheets

Quick overview

This workflow captures website form leads via a webhook, screens and scores them with OpenAI, logs every lead to Google Sheets, and creates Gmail reply and follow-up drafts (optionally alerting Slack for hot or risky leads) so you can review before sending.

How it works

  1. Receives a new lead from a POST webhook (or a manual test lead), or runs on a weekday 9 AM schedule to check for follow-ups.
  2. Normalizes the form payload, validates the email, and screens for spam, bots, prompt-injection patterns, risky content, and an optional shared secret.
  3. For valid new leads, looks up the email in Google Sheets to skip drafting if the same contact was handled recently.
  4. Uses OpenAI to return structured qualification data (fit score, category, intent, budget, timeline, urgency, missing info, and a short owner summary) and assigns a tier (hot, warm, poor fit, spam, or needs review).
  5. Drafts a personalized first reply in Gmail for hot/warm leads using OpenAI, or drafts a fixed polite decline for poor fits, and then scrubs the text for prices/discounts/guarantees by replacing them with confirmation tags.
  6. Appends the lead, qualification results, and any Gmail draft/thread IDs to Google Sheets, and optionally posts an alert to Slack for hot leads or leads marked as needing human review.
  7. On scheduled runs, reads “waiting” leads from Google Sheets, checks Gmail for replies and sent messages, drafts an OpenAI follow-up in the same thread when due, and updates the Google Sheet to mark leads as replied or follow-up drafted.

Setup

  1. Add credentials for OpenAI, Google Sheets, and Gmail, and add Slack credentials if you want alerts.
  2. Create a Google Sheet with a tab named “Leads” (or update the tab name), then paste the spreadsheet URL into the workflow settings.
  3. Update the configuration fields (business details, ideal client/not-a-fit criteria, booking link, thresholds, and optional Slack channel ID and webhook shared secret) before enabling the workflow.
  4. Copy the production webhook URL and configure your website form tool to send lead submissions to it (optionally including the x-webhook-secret header if you set a shared secret).