Once traffic grows or you want more control over operations and data, self-hosting becomes the natural next move.
2 / 13
system flow
End-to-end automation architecture
Automation using webhook mechanisms and n8n workflows
Cusdis
comment
→
n8n Workflow
Webhook
node
→
Gemini
analysis
→
Code
cleanup
→
If
branch
→
Wait
delay
→
HTTP
Request
Complete workflow
When a comment is posted, Cusdis sends an event to the configured webhook API URL.
We show how to set up a webhook in n8n to receive these events and build a workflow for automated processing.
Key points
Convert `approve_link` into an API endpoint before calling itGemini node
The LLM returns `NORMAL` or `SPAM` plus a reply draft as JSONGemini node
Waiting before replying makes the behavior feel less roboticWait node
3 / 13
n8n hosting
n8n Cloud vs self-host
If speed matters most, n8n Cloud is the smoother path.
Self-hosting with Docker Compose means you own the exposure, upgrades, and security decisions.
If you choose Cloud
Domain and HTTPS setup mostly disappears
You can focus on the workflow instead of installation
Replace 'your-domain.com' with the domain your n8n instance is running on.
If you are new to operations, start on n8n Cloud and move to self-hosting after the workflow has proven itself.
4 / 13
public https
Giving self-hosted n8n a public HTTPS domain
Cusdis webhooks need a reachable HTTPS URL.
Expose your n8n instance safely using modern tunneling technology.
You can skip this slide: If you use n8n Cloud, or your n8n is already running on a public server with HTTPS, skip this page and move on.
Why a public URL is required
Self-hosted instances are usually hidden behind local networks. Since n8n practically requires HTTPS for security and reliable communication, setting up a Domain+HTTPS path is critical. Using Cloudflare is one of the easiest and most reliable ways to achieve this.
Why Cloudflare Tunnel
If your domain is already managed by Cloudflare, one Tunnel is all you need to expose an internal service safely — no extra server required. Unlike ngrok, the URL is stable and free.
Setup steps
Go to Cloudflare Networks > Connectors and click "Create a tunnel".
Map your domain to your internal n8n address (Route).
If you are running n8n via Docker, specify the port it uses.
Set up the HTTPS domain so webhooks land safely.
Enter "n8n" in the subdomain field (e.g., n8n.yourdomain.com).
Set Service Type to http and enter the address where n8n is running.
(e.g., if your IP is 192.168.219.101 and the Docker port is 5678, enter 192.168.219.101:5678 in the URL field.)
Gemini Analysis Node — spam detection and reply drafting
The important part is constraining the model to return a clean JSON contract.
1 Adding the Gemini Message node
Create credentials with an API key from Google AI Studio
Recommend the current stable model code `gemini-2.5-flash-lite`
The screenshot may show an older model name, so trust the live model picker in the UI
Turn on both `Simplify Output` and `Output Content as JSON` so the next node stays simple
2 Model, prompt, and JSON output settings
Prompt, copy and paste it
You are an AI assistant helping the blog owner.
Read the comment below, decide whether it is spam, and if it is a normal comment, write a short thank-you reply. (The reply should be friendly, 1-2 sentences long, and match the language of the comment.)
Comment: "{{ $json.body.data.content }}"
[Output rules]
Return exactly one pure JSON object with the structure below. Do not wrap it in Markdown.
Comment: "{{ $json.body.data.content }}"
[Output rules]
1. Return only JSON (rfc8259), with no explanation and no markdown fences.
2. Follow the JSON schema below exactly.
{
"result": "NORMAL" or "SPAM",
"reply": "The drafted reply text (empty string for SPAM)",
"approved_link": "{{ $json.body.data.approve_link }}"
}
Build an end-to-end comment moderation flow with n8n, Gemini, and Cusdis.
A practical beginner-friendly course for automating blog comment operations, from webhook wiring and AI moderation to conditional routing, approval APIs, and ops checklists.
Deliverable: a production-minded workflow that analyzes, delays, approves, and replies to safe comments automatically.