Data Sync & ETL
Triage website form enquiries with OpenAI and Google Sheets
When an API call/webhook arrives, it moves and syncs data with OpenAI / ChatGPT using Google Sheets.
What it does
## Triage website form enquiries with OpenAI, spam filtering and a Google Sheets review queue ### Quick overview For small teams whose website form fills up with a mix of sales leads, support requests, job applications and spam. Each enquiry is checked, scored by an OpenAI model against a category list you control, and written to one of three Google Sheet tabs: Enquiries, Review or Spam. Nothing is sent to the person who filled in the form. ### How it works 1. A webhook receives the form as a POST (JSON or form-encoded) with name, email, company and message. No valid email means HTTP 400. A filled honeypot field means a bot, which gets a quiet 200 and is not logged. 2. The same email and message within 24 hours is answered as a duplicate and not logged twice, so double clicks and replays don't cost an AI call. 3. The model returns JSON with a category id, a confidence score, an urgency and a one-line summary. 4. A Code node checks that reply. An unknown category, broken JSON, an API error or a score under your threshold sends the enquiry to the Review tab, with the reason in check_notes. Spam needs a higher score, so a real lead is not buried in the Spam tab. 5. A Switch writes the row to Enquiries, Review or Spam. If Google Sheets fails, the form gets HTTP 500 so it can show a retry message instead of a false "thanks". ### Setup 1. Create a Google Sheet with three tabs: Enquiries, Review and Spam. Header rows are written on the first run. 2. Add a Google Sheets credential and an OpenAI credential in n8n. 3. In *Settings (edit me)*, replace YOUR_GOOGLE_SHEET_URL and adjust the categories, priorities and thresholds. 4. Add a hidden website field to your form for the honeypot, activate the workflow and point the form at the production webhook URL (path lead-triage). ### Requirements - A Google account with Google Sheets - An OpenAI API key, or any OpenAI-compatible API via the credential's Base URL ### How to customize - Categories, priorities, the two confidence thresholds, the duplicate window and the honeypot field name are all in *Settings (edit me)*. The prompt and the check read the same list. - Map your form's field names in *Normalize and Route Request*. - To protect the webhook, turn on Header Auth on the Webhook node. Need WhatsApp handling, human handoff and opt-out? A production version is available at https://zhangautomation.gumroad.com/l/ecvlr
The steps
- Receive Enquiry (POST)
- Settings (edit me)
- Normalize and Route Request
- Valid, Bot or Invalid?
- Reject Invalid Email (400)
- Quietly Accept Bot (200)
- Check for Duplicate
- Already Received?
- Answer Duplicate (200)
- Classify Enquiry with AI
- OpenAI Chat Model
- Validate AI Result
- Route by Outcome
- Add to Review Tab
18 steps in total.
Similar automations
Email AutomationLog hotel booking enquiries to Google Sheets with WhatsApp and Gmail7 stepsEmail AutomationReply to Gmail Enquiries with GPT-4o and Dumpling AI8 stepsAlerts & NotificationsDeduplicate webhook enquiries with data tables and Telegram notifications27 stepsForms & SurveysTriage Public Form Submissions with a Claude RAG Agent11 steps