A marketing website does not need a monolithic application server just to capture leads. When we built Makeweave’s own site on Astro, we wanted static HTML speed on the frontend, full ownership of our CRM database in the EU, and an automation layer we could later extend with AI triage—without paying $100+/month for bundled funnel SaaS.
To be technically precise: Astro itself has no backend, while our functional backend is split cleanly between an n8n webhook workflow and a self-hosted Twenty CRM instance.
Architecture overview
[Astro Static Form]
│ POST JSON + hidden honeypot
▼
[n8n Webhook /makeweave-contact]
│ Validate lengths · Escape HTML · Drop bots silently
├──► [Gmail OAuth2] ──► Team brief → hello@makeweave.com (Proton Mail)
├──► [Gmail OAuth2] ──► Branded confirmation → Visitor (Reply-To: hello@makeweave.com)
└──► [Twenty CRM Branch (parallel, non-blocking)]
1. GET /rest/people?filter=emails.primaryEmail[eq]:<email>
2. POST /rest/people (only if not found)
3. POST /rest/opportunities (stage: NEW, linked to Person)
4. POST /rest/notes + /rest/noteTargets (linked to Person & Opportunity)
Exact payload and spam filtering
The browser posts a compact JSON payload directly from Astro:
{
"name": "Alex Rivera",
"email": "alex@company.com",
"message": "Looking for a technical SEO & GEO audit before our Q2 relaunch.",
"source": "https://makeweave.com/?utm_source=linkedin#contact",
"website": ""
}
Inside n8n, a single JavaScript code node checks field lengths, validates email syntax, escapes < > & " ' before rendering HTML emails, and inspects the hidden website honeypot. If a bot fills website, the webhook returns a silent 200 OK without sending any email or touching Twenty—avoiding CAPTCHA friction for real humans.
Deduplicating contacts in Twenty CRM
Naive webhook-to-CRM setups break the second time the same prospect writes in. Instead of blindly calling POST /rest/people, our workflow queries emails.primaryEmail first:
- Existing contact: reuses the returned
person.idand opens a freshOpportunityin stageNEW. - New contact: splits the full name into
firstName/lastName, creates thePerson, then creates theOpportunity. - Context preservation: writes a Markdown
Notecontaining the full message, UTC timestamp, andsourceURL (preserving UTM parameters from LinkedIn, YouTube, or Instagram) and links it vianoteTargetsto both the Person and the Opportunity.
Honest trade-offs: residency, reliability, and cost
Self-hosting is not “free”—it trades per-seat SaaS fees for modest VPS hosting and disciplined operations:
- Data residency vs. sub-processors: Twenty CRM and its PostgreSQL database run on Hetzner in Germany (with automated off-site backups), and our team inbox runs on Proton Mail in Switzerland. Transactional confirmation emails currently traverse Gmail OAuth2 until we migrate outbound SMTP to our custom domain—something we state transparently in our Privacy Policy.
- Failure handling: Running the Twenty branch in parallel ensures CRM maintenance never blocks the visitor’s
200 OKor the team’s email brief. Because a parallel branch is not a durable message queue by itself, the email tohello@makeweave.comserves as our immediate fallback; for high-volume client pipelines, we add a persistent retry queue.
Explore how we combine web engineering and automation in our services overview.
Key questions
Why self-host Twenty CRM instead of using a spreadsheet or all-in-one SaaS?
Spreadsheets quickly break once you need Kanban stages, linked notes, and follow-up ownership. Self-hosting Twenty avoids per-seat SaaS licensing fees while keeping full REST/GraphQL API access and EU database control—at the trade-off of managing your own Docker updates and backups.
What happens if Twenty CRM is restarting when a visitor submits the form?
The CRM sync runs on a parallel branch with continue-on-fail enabled, so the browser still gets a 200 OK and the team still receives the full lead brief by email. For high-volume pipelines requiring guaranteed CRM replay, we add a persistent queue or retry workflow.