← All guides

Facebook Lead Ads → n8n: webhook setup that survives production

2026-10-09

n8n is a great place to process Facebook leads — but the n8n forums are full of the same two traps. Here is the setup that avoids both.

Trap 1: the test URL

An n8n Webhook node has two URLs: …/webhook-test/… (live only while you press "Listen for test event") and …/webhook/… (live only while the workflow is active). If you paste the test URL into the Meta App Dashboard, everything works during setup and dies the moment you close the editor. Always register the production URL and activate the workflow.

Trap 2: one callback for everything

Meta sends all leadgen events for the app to one URL. The payload only carries ids — leadgen_id, page_id, form_id — so your workflow must fetch the actual answers from the Graph API (GET /<leadgen_id>?fields=field_data, requires the leads_retrieval permission). And if a second system needs the same lead, you are back to the one-URL problem: you cannot register n8n and your CRM.

A durable setup

1) Register a relay URL (or your n8n production URL if n8n is the only consumer) in App Dashboard → Webhooks → Page → leadgen. 2) Subscribe the Page to the app (POST /<page_id>/subscribed_apps with subscribed_fields=leadgen). 3) Test with Meta's Lead Ads Testing Tool rather than real ads. 4) Make the endpoint return 200 fast and do slow work afterwards — Meta retries failures for a while and then stops delivering to endpoints that keep erroring.

With Relayo in front, n8n keeps its own URL (test it, break it, rebuild it) while the CRM and every other tool still receive each lead — with retries and a replay button.

Get early access to Relayo