The Real-World Pain
说明与用途
问题:Stripe、Meta 和 CRM 的 webhook 在自托管 n8n 后的 Cloudflare 隐失。解决方案:拆分接收与处理,添加 HMAC 验证和幂等键,并加固代理超时。
问题
Inbound webhook payloads from Stripe, Meta WhatsApp, or CRM endpoints vanish on self-hosted n8n instances behind Cloudflare tunnels or reverse proxies, causing missed executions and false‑positive statuses.
结果
Webhook payloads are reliably received, processed idempotently, and proxy timeouts are eliminated, preventing missed executions and duplicate actions.
工作流
- Create a lightweight ingestion workflow with a Webhook node that immediately validates the signature and responds 200 OK.
- Push the raw payload to a message broker or queue (Redis list or internal database).
- Trigger a secondary workflow via a Schedule or Queue Trigger to process items asynchronously.
- Use a Code node to compute an HMAC SHA‑256 hash, check a Redis cache for duplicate event IDs, and store processed IDs with a 24‑hour TTL.
- Harden Docker and Cloudflare/ngrok configurations by explicitly setting execution timeouts and correct binding parameters in docker‑compose.yml.
证据
Inbound webhook payloads from Stripe, Meta WhatsApp, or CRM endpoints simply vanish.
Create a lightweight "Ingestion Workflow" whose only job is to validate the webhook signature, return an immediate 200 OK to the sender, and push the raw payload directly into a message broker or queue.
Use a Code Node immediately following your webhook entry point to compute an HMAC SHA-256 hash using the provider's secret.
Ensure your docker-compose.yml explicitly defines execution timeouts and correct binding parameters.
- 记录日期: 2026-11-02T18:14:15.287Z