Website Lead Notification
1. What? — Definition and context
Section titled “1. What? — Definition and context”The Website Lead Notification workflow instantly notifies admins on Telegram as soon as a visitor fills out the Odoo contact form. The CRM opportunity is created automatically on the Odoo side, and N8N sends a formatted message with the prospect’s details.
Data flow
Section titled “Data flow”| Step | Component | Action |
|---|---|---|
| 1 | Odoo form | Visitor submits the contactus form |
| 2 | Odoo CRM | Automatically creates an opportunity |
| 3 | Automated Action | Detects the new lead (medium=Website) |
| 4 | Odoo webhook | Sends data to N8N (internal network) |
| 5 | N8N workflow | Formats and routes to Telegram |
2. Why? — Stakes and motivations
Section titled “2. Why? — Stakes and motivations”Problems solved
Section titled “Problems solved”| Problem | Without this workflow | With this workflow |
|---|---|---|
| Response time | Lead discovered the next day | Instant notification |
| Missed leads | Forget to check the CRM | Push to mobile |
| Lost context | Go back into Odoo to see details | All info inside Telegram |
Why use an internal webhook?
Section titled “Why use an internal webhook?”| Approach | Advantage | Drawback |
|---|---|---|
| Internal webhook (Docker) | Secure, no auth needed | Only for Docker services |
| Polling Odoo API | Simpler to set up | Latency, server load |
| External webhook | Reachable everywhere | Requires auth + TLS |
3. How? — Technical implementation
Section titled “3. How? — Technical implementation”Architecture
Section titled “Architecture”Webhook security
Section titled “Webhook security”| Aspect | Configuration |
|---|---|
| Internal URL | http://n8n:5678/webhook/odoo/website-lead |
| External access | Blocked by Caddy (403 Forbidden) |
| Authentication | None (internal Docker traffic) |
Caddy configuration:
@internal_webhooks { path /webhook/notify/* path /webhook/prometheus/* path /webhook/odoo/*}handle @internal_webhooks { respond "Forbidden" 403}Odoo configuration
Section titled “Odoo configuration”Menu: Settings → Technical → Automation → Automated Actions
| Field | Value |
|---|---|
| Name | N8N: Notify on Website Lead |
| Model | Lead/opportunity (crm.lead) |
| Trigger | On save |
| Apply on | [('medium_id.name', '=', 'Website')] |
| Action | Send a webhook notification |
| URL | http://n8n:5678/webhook/odoo/website-lead |
Sent fields:
name— Opportunity namecontact_name— Contact nameemail_from— Emailphone— Phonepartner_name— Company namedescription— Form message
N8N configuration
Section titled “N8N configuration”Format Lead Node (Code):
const lead = $json.body;
const message = `👤 Contact: ${lead.contact_name || lead.name || 'Not provided'}🏢 Company: ${lead.partner_name || 'Not provided'}📧 Email: ${lead.email_from || 'Not provided'}📱 Phone: ${lead.phone || lead.mobile || 'Not provided'}
💬 Message:${lead.description ? lead.description.substring(0, 500) : 'No description'}
📋 https://odoo.guigpap.com/odoo/crm/${lead._id}`;
return { json: { source: "odoo_website_form", type: "new_lead", severity: "info", title: `🌐 New opportunity: ${lead.contact_name || lead.name}`, message: message, timestamp: new Date().toISOString(), hasCallback: false }};Test commands
Section titled “Test commands”# Test the webhook from Odoodocker exec odoo curl -s -X POST \ "http://n8n:5678/webhook/odoo/website-lead" \ -H "Content-Type: application/json" \ -d '{ "_id": 999, "_model": "crm.lead", "name": "Test Lead", "contact_name": "Jean Dupont", "email_from": "jean@test.com", "phone": "+33 6 12 34 56 78", "partner_name": "Test Company", "description": "Test message" }'# Expected: {"status": "ok"} + Telegram notification
# Check Docker connectivitydocker exec odoo curl -s http://n8n:5678/healthz4. What if? — Outlook and limits
Section titled “4. What if? — Outlook and limits”Current limits
Section titled “Current limits”| Limit | Impact | Mitigation |
|---|---|---|
| Unidirectional webhook | No read-receipt | Link to Odoo in the message |
| No Telegram reply | Manual return to Odoo | Planned: action buttons |
| N8N dependency | No notification if N8N is down | N8N container monitoring |
Evolution scenarios
Section titled “Evolution scenarios”If you need to reply from Telegram:
- Add inline buttons (Assign, Qualify, Call)
- Callback to Odoo to update the lead
- Confirmation notification
If lead volume grows:
- Filter by lead score
- Rotate assignments
- Hourly digest instead of instant push
If multi-channel is needed:
- Add ntfy as backup
- Email notification for VIP leads
- Slack integration if a team is involved
Troubleshooting
Section titled “Troubleshooting”| Problem | Check |
|---|---|
| No notification | N8N: workflow active? Notification Hub executed? |
| Webhook timeout | docker exec odoo curl http://n8n:5678/healthz |
| Missing data | Check selected fields in the Odoo webhook |
| Quiet hours | Notification deferred if 22:00-07:00 (except severity=critical) |
Related pages
Section titled “Related pages”Workflows
Section titled “Workflows”- Notification Hub — Routing to Telegram
- Cal.com → Odoo CRM — Appointment sync
Infrastructure
Section titled “Infrastructure”- Security Stack — Caddy configuration
- Odoo 18 on Docker — ERP configuration