If you've ever wondered how n8n manages to "find out" the instant a payment, a lead, or a message comes in, the answer has a name: webhook. A webhook in n8n is a unique URL the platform generates so other applications can send it data at the exact moment an event occurs: instead of your workflow asking every five minutes whether there's anything new, the external system notifies it with an HTTP request the moment something happens. It's the most important trigger in n8n because it works in real time and with any application capable of making an HTTP call — which is to say, practically all of them. If you understand webhooks, you've unlocked 80% of how n8n works.
Webhook vs polling: the difference that defines your automations
There are two ways for a workflow to find out that something happened:
- Polling: the workflow asks the external system every X minutes, "is there anything new?". Most of the time the answer is no, and when it's yes, minutes have already passed.
- Webhook: the external system notifies n8n the instant the event occurs. Zero delay, zero pointless queries.
| Criterion | Webhook | Polling |
|---|---|---|
| Speed | Immediate (under 1 second) | 1 to 15 minute delay depending on interval |
| Resource usage | Only runs when there's data | Runs even when there's nothing new |
| Requirement | The sending system must be able to send HTTP | Only needs a queryable API |
| Typical risk | Poorly protected public URL | Missing events between checks |
| Ideal case | Payments, leads, messages, alerts | Legacy systems with no outbound webhooks |
The practical rule: if the source system can emit webhooks, always use them. Polling is the plan B for old systems that don't notify anything on their own.
How the n8n Webhook node works: test vs production URL
When you drag a Webhook node onto the canvas, n8n generates two different URLs for you, and confusing them is the number one cause of "it's not working":
- Test URL (
https://your-n8n.com/webhook-test/abc123): only listens while you have the editor open and have clicked Listen for test event. It's for development: you send a test request, see the data that arrived, and build the rest of the flow against that real structure. - Production URL (
https://your-n8n.com/webhook/abc123): only responds when the workflow is active (the Active toggle in the top corner). This is the one you configure in the external system once the flow is ready.
The correct workflow is: you develop against the test URL, and when everything works, you activate the workflow and switch the sender's configuration to the production URL. In the node you also choose the HTTP method (POST for almost everything), the path (you can give it a readable name like /webhook/new-lead) and the response mode, which we'll cover in the classic mistakes section.
Three real webhook examples in n8n
1. Receiving a form from your website
Your contact form sends a POST to the webhook URL with name, email, and message. From there, n8n can create the contact in the CRM, send an automatic reply, and notify the salesperson on WhatsApp. It's the foundation of any automated lead follow-up project, and the first webhook we recommend implementing: low risk, visible impact within days.
2. Mercado Pago payment notifications
Mercado Pago sends a notification to your webhook every time a payment's status changes. The payload carries the event type and an ID; your workflow returns 200 immediately and then queries the payments API with that ID to find out whether the payment was approved. With that, you can reconcile collections without touching a spreadsheet — we break it down step by step in the guide on automated collections with n8n and Mercado Pago.
3. Events from your CRM or internal system
HubSpot, Pipedrive, and most modern CRMs can fire webhooks when a deal changes stage or a contact is created. If your system is custom-built, adding an outbound webhook is a relatively simple piece of API development: an HTTP call at the point in the code where the event occurs. With that, n8n becomes the nervous system connecting your CRM with billing, support, and reporting.
Got systems that don't talk to each other? Book a 30-minute meeting and we'll show you which webhooks would unblock your operation, no strings attached.
The 3 classic webhook mistakes in n8n (and how to avoid them)
These three mistakes show up in almost every project we inherit. Check for them before hunting down more exotic problems.
Mistake 1: the workflow is inactive
You configured the production URL in Mercado Pago or in your form, you test it… and nothing. The 404 or the silence almost always means the workflow doesn't have the Active toggle switched on. The production URL doesn't exist until you activate the flow. And the reverse: the test URL stops listening the moment you close the editor, so never use it in real configurations.
Mistake 2: responding after processing (timeouts and retries)
By default, the webhook can wait for the entire workflow to finish before responding. If your flow takes 30 seconds to generate a PDF and send three emails, the sending system has already dropped the connection: Mercado Pago, for example, expects a response within a few seconds and if it doesn't arrive, it retries the send, which means your workflow runs two or three times for the same event.
The solution has two parts:
- Configure the node to respond as soon as the data is received (Respond Immediately) or use the Respond to Webhook node at the start of the flow, and process calmly afterward.
- Make the workflow idempotent: before creating records, check whether that event ID has already been processed. That way, retries don't duplicate invoices or contacts.
Mistake 3: leaving the public URL unprotected
The webhook URL is accessible from the internet: anyone who has it can send junk or malicious data to it. Three layers of defense, from least to most effort:
- Unpredictable path: don't use
/webhook/leads; the random ID n8n generates is already a first barrier. - Header authentication: the Webhook node supports Header Auth and Basic Auth natively; the sender includes a secret token in every request and n8n rejects anything that doesn't carry it.
- Signature validation: serious services sign their notifications (Mercado Pago uses the
x-signatureheader). Verifying that signature in a Code node guarantees the message came from who it claims to and wasn't tampered with.
For sensitive data —payments, personal data, medical information— all three layers together aren't paranoia, they're the minimum. It's one of the things we're most careful about in our AI automation projects, where webhooks tend to move business-critical information.
When a webhook isn't the best option
To be honest, there are scenarios where something else is the better fit:
- The source system doesn't emit webhooks (old ERPs, desktop software): there, polling with a Schedule Trigger every 5-15 minutes is the realistic option.
- You need to process large batches (syncing 50,000 products overnight): one webhook per product is inefficient; a scheduled job that pulls everything at once is better.
- The event requires a complex, synchronous response (a search engine, a live quoting tool): that's the territory of a custom API, not an automation webhook. If your case looks like this, you probably need AI integration or a custom API, with n8n as a secondary orchestrator.
Start with a webhook this week
If you want to learn, the classic exercise: create a workflow with a Webhook node, send it a POST with curl or from your form, look at the data that arrives, and connect a Gmail or Google Sheets node. In an hour you'll understand the pattern that underpins every serious automation.
And if what you want is results in production —secure, idempotent, monitored webhooks connected to your real systems—, at Deepyze we do it every day for companies in Argentina and LATAM. A fixed price agreed before we start, a concrete proposal within 24 hours, and a team that works in your time zone. Tell us what you need to connect and we'll design it with you.
Frequently asked questions
What is a webhook in n8n?+
It's a unique URL that n8n generates to receive data from other applications in real time. When an event happens —a payment, a submitted form, a new lead— the external system makes an HTTP request to that URL and the workflow runs instantly.
Why does my n8n webhook return a 404 error?+
Almost always because the workflow is inactive. The production URL only responds when the workflow has the Active toggle switched on. The test URL, on the other hand, only listens while you have the editor open and have clicked Listen for test event.
What is the difference between a webhook and polling?+
With polling, your workflow checks every X minutes whether there's new data, which creates delay and wasted resource usage. With a webhook, the external system notifies you at the exact moment the event occurs. The webhook is real time; polling always arrives late.
Is it safe to expose an n8n webhook URL?+
The URL is public by design, so anyone who knows it can send data to it. That's why you should protect it with header authentication, validate the sender's signature (like Mercado Pago's x-signature), and discard any payload that fails validation.
What do I do if the system calling the webhook demands a fast response?+
Use the Respond to Webhook node to return a 200 as soon as you receive the data, then process afterward. Services like Mercado Pago expect a response within a few seconds and will retry —or flag an error— if your workflow takes too long to answer.
Want this working in your company?
At Deepyze we turn manual processes into systems that work on their own: AI automation, web and mobile apps, and custom software. Tell us your case and you will have a concrete proposal within 24 hours.
Sin compromiso · Respuesta en 24 hs · Equipo en tu mismo huso horario