Hello n8n community!
I wanted to share how I leveraged n8n as the powerful backend for my blog’s contact form after migrating away from a third-party form service (Web3Forms).
My goal was to create a more secure, customizable solution where I had complete control over data processing and email delivery. The architecture I built consists of three components:
- Frontend: HTML/JavaScript form with client-side validation and hCaptcha
- Middleware: Cloudflare Worker that handles form submission, security checks, and forwarding
- Backend: n8n workflow for data validation, formatting, and email delivery
The n8n workflow is the heart of the system, handling crucial tasks like:
- Additional validation of email format and message content
- Handling edge cases (empty messages, excessive length)
- Formatting submission data consistently
- Sending properly formatted emails
What I love about using n8n for this is the visual workflow builder that still gives me complete control. I can easily modify the processing logic without touching the frontend or middleware code. The code node in my workflow lets me implement custom validation rules that would be impossible with most form services.
In my blog post, I share the full technical implementation, including the code for my n8n workflow and how it integrates with the other components: Building a Secure Contact Form: From Third-Party Services to Custom Implementation - Fanyang Meng’s Blog
Has anyone else used n8n for handling form submissions or similar use cases? I’d love to hear about your implementations!