See llms.txt for all machine-readable content.

Back to Templates

Qualify website form leads, reply in their language, and log to Sheets with OpenAI, Gmail, and Telegram

Quick overview

This workflow captures website form leads via a webhook, validates and scores them with OpenAI, stores and updates them in Google Sheets, replies via Gmail in the lead’s language, and notifies you on Telegram with hot-lead alerts plus a daily digest and automated follow-ups.

How it works

  1. Receives a POST webhook request from your website form and immediately returns a success, spam-ignored, or validation-error response.
  2. Normalizes the submission fields, checks for spam (honeypot/too many links) and required consent, and extracts a clean lead profile.
  3. Looks up the lead by email in a Google Sheets “Leads” tab to detect returning contacts and pull prior status/history.
  4. Sends the lead details and history to OpenAI to classify the request, score fit, extract key details, and draft a plain-text reply in the lead’s language.
  5. Optionally sends the drafted reply using Gmail, then upserts the lead row in Google Sheets with the AI results, message metadata, and timestamps.
  6. Sends a Telegram alert for hot leads or when the AI step fails and the lead is marked for manual review.
  7. Every morning, reads the full Google Sheet to send a Telegram digest and, when due, generates a follow-up with OpenAI and replies in the same Gmail thread, then records the follow-up result back to Google Sheets.

Setup

  1. Create a Google Sheets spreadsheet with a “Leads” sheet and the required header columns (Email, Name, Phone, Company, Language, Category, Score, Priority, AI summary, Budget, Urgency, Next step, Message, Source, Consent, Status, First contact, Last contact, Submissions, Reply sent at, Reply message ID, Thread ID, Follow-up sent at, Notes).
  2. Add credentials for Google Sheets, Gmail, Telegram, and OpenAI (Chat model) in n8n.
  3. Update the spreadsheet URL/ID in all Google Sheets nodes and set your Telegram chat ID, business name/context, consent requirements, and follow-up settings in the Configuration step.
  4. Copy the production webhook URL and configure your website form to POST submissions to it, including a consent field (and optionally a honeypot field) that matches the workflow configuration.