Templates / AI Contact Form Spam Filter: Classify & Route Submissions

AI Contact Form Spam Filter: Classify & Route Submissions

Intermediate   Apps: OpenAI, Google Sheets, Gmail  ·  Setup: 10 minutes

Contact forms on websites receive both genuine inquiries and spam, requiring manual review to distinguish between them. This workflow uses AI to instantly classify each submission as spam or legitimate, logs all submissions to a Google Sheet, and only sends you email notifications for legitimate leads. Spam submissions are quietly logged without alerts, saving you time filtering manually.

Download workflow JSON (free) Setup guide

What this workflow does

  1. A Webhook node receives form submissions from your website.
  2. An OpenAI node classifies the submission as spam or legitimate with a confidence reason.
  3. An IF node routes spam to a 'Spam Log' sheet, and legitimate submissions to a 'Leads' sheet.
  4. For legitimate submissions, a Gmail node sends you an alert with the lead details.
  5. All submissions are tracked in sheets for analytics and training improvements.

Setup guide

  1. Import the JSON into n8n (Workflows > Import from File).
  2. Connect OpenAI, Google Sheets, and Gmail in their respective nodes.
  3. Replace REPLACE_WITH_SPREADSHEET with your Google Sheet ID.
  4. Set up the Webhook URL on your website's contact form handler.
  5. Customize the AI classification prompt to match your spam patterns.
  6. Test with sample submissions before going live.

Want this running 24/7?

Self-host n8n on a cheap VPS and this workflow runs around the clock for less than a coffee a month.

Get an n8n VPS from $5/month

FAQ

How accurate is the AI spam detection?Accuracy depends on your training data and prompt specificity. Start with the default prompt and refine it based on false positives/negatives you observe. Most users achieve 85-95% accuracy after initial tuning.
Can I customize the spam definition?Absolutely. Edit the OpenAI prompt to specify what constitutes spam for your use case. Include examples of common spam patterns, suspicious keywords, or legitimate inquiry characteristics.
What happens to form submissions during n8n downtime?Webhooks will fail during n8n downtime. Consider adding error handling with an 'Error Trigger' workflow that sends you alerts when submissions are missed, or implement a temporary storage solution.

Want the workflows this one is a warm-up for?

The Mega Bundle packs both WorkflowForge Pro volumes — 32 production-grade workflows: automations (cart recovery, lead scoring, invoice extraction) and AI agents (support agent, calendar assistant, research agent), each with a setup guide. $39 for both, instant download.

Get the Mega Bundle →

Need it customized for your exact process?

I build custom n8n automations and AI agents professionally: your tools, your edge cases, tested and documented.

Hire me on Fiverr →