Quick overview
This workflow receives website form submissions via a webhook, validates and de-duplicates them, uses OpenAI to classify and score each enquiry (including spam detection), and appends the result to one of three Google Sheets tabs for triage and review.
How it works
- Receives a POST request on an n8n webhook containing form fields (name, email, company, message) and rejects invalid emails with an HTTP 400 response.
- Detects bots using a hidden honeypot field and returns a quiet HTTP 200 response without logging the submission.
- Checks for duplicate submissions (same email and message within the configured time window) and returns HTTP 200 without reprocessing or re-logging.
- Sends the enquiry and the allowed category list to an OpenAI chat model to return a JSON classification with category, confidence, urgency, and a short summary.
- Validates the AI output and routes low-confidence, unknown-category, or error cases to a human review queue while applying a stricter confidence threshold for spam.
- Appends the enquiry to the appropriate Google Sheets tab (Enquiries, Review, or Spam) and responds with HTTP 200 on success or HTTP 500 if the sheet write fails.
Setup
- Create a Google Sheets spreadsheet with three tabs named Enquiries, Review, and Spam (or update the tab names in the workflow settings).
- Add Google Sheets credentials and an OpenAI credential (or an OpenAI-compatible credential with a custom Base URL) in n8n.
- Update the Google Sheet URL and adjust categories, priorities, thresholds, deduplication window, and honeypot field name in the Settings (edit me) node.
- Configure your website form to include a hidden honeypot field (default: website), activate the workflow, and point the form action to the production webhook URL path lead-triage.
Additional info
Need WhatsApp handling, human handoff and opt-out? A production version is available at https://zhangautomation.gumroad.com/l/ecvlr