n8n Webhook node: test URL, production URL and security
A webhook only works in production once the workflow is published
The n8n Webhook node gives a workflow a URL that other apps call when something happens. It has two of them: the test URL listens for 120 seconds after you click Listen for test event and shows the data in the editor, while the production URL works only once the workflow is published and records each run under Executions (n8n docs). Most broken webhooks come down to that difference.
A webhook is the sending app telling you something happened, instead of your workflow asking it every few minutes. A form is submitted, a payment succeeds, a call is missed, and the app posts the details to your URL straight away. n8n describes the node as a trigger that can also return data at the end of the workflow, so it doubles as a small API endpoint (Webhook node docs). If you want the plain language version of how webhooks sit next to APIs and logins, read what "plugs into your stack" means; the rest of this guide is the n8n detail.
The goal is to get a webhook from "works in the editor" to "safe to give to Stripe, a form provider or a phone system". That takes the right URL, a deliberate response, a lock on the door and a plan for the same event arriving twice. Every setting below is taken from n8n's and Stripe's own documentation as it reads today.

If a webhook is already carrying payments or bookings and you are not sure it is locked down, we can check it with you. Book a call with GenovaFlow AI
The test URL listens for 120 seconds, the production URL needs a published workflow
The two URLs are registered at different moments. n8n registers the test webhook when you select Listen for test event, or Execute workflow if the workflow is not active, and it shows the incoming data in the editor. It registers the production webhook when you publish the workflow, and data sent there does not appear in the editor: you open the workflow's Executions tab and pick the run (n8n docs). The paths differ too, webhook-test for the test URL and webhook for production by default (endpoint variables).
That explains the most common complaint, a webhook that only works when someone clicks Execute workflow. The sender has the test URL, which stops listening two minutes after you click. Give it the production URL and publish the workflow, then look for runs under Executions rather than on the canvas.
Some apps hold only one webhook address, which turns the switch between URLs into a trap. n8n's WhatsApp Trigger docs say "WhatsApp only allows you to register a single webhook per app", so moving between the test and production URL overwrites the registered address and only one of them receives events (n8n WhatsApp Trigger docs). Telegram bots behave the same way, as the troubleshooting section of the Gemini voice agent for Telegram explains. Test on a separate app or bot, and leave the live one on the production URL.
Two more rules catch people out. n8n "only permits registering one webhook for each path and HTTP method combination", so two published workflows on the same path and method conflict until you unpublish one or change its path or method (common issues). And every call to a production webhook is a run you pay for on n8n's plans, because "an execution is a single run of your entire workflow", however many steps it has (n8n pricing).
Set the method, the path and how the node answers
The node accepts DELETE, GET, HEAD, PATCH, POST and PUT, and most apps that send events use POST with a JSON body. The path is random by default; a readable path such as /stripe-events is easier to manage, and route parameters let one webhook take values from the URL itself (Webhook node docs):
/:variable
/path/:variable
/:variable/path
/:variable1/path/:variable2
/:variable1/:variable2The Respond setting decides what the caller gets back, and it matters more than it looks, because many senders judge success by the answer alone.
| Respond option | What the caller receives | Use it for |
|---|---|---|
| Immediately | The response code and the message "Workflow got started." | Event senders such as Stripe that only need to know you received it |
| When Last Node Finishes | The output of the last node that ran | Short workflows that act like an API call |
| Using Respond to Webhook node | Whatever that node sends | Custom status codes, JSON, redirects or text |
| Streaming response | Data streamed back as it is produced | Chat front ends talking to an AI agent node |
The Respond to Webhook node gives you full control: it can reply with JSON, text, a binary file, a redirect, a JWT token or nothing, with your own status code and headers (Respond to Webhook docs). It runs once, on the first item that reaches it, and a second one later in the workflow is ignored. If the workflow ends without reaching it, the caller gets a standard message with a 200; if the workflow errors before it runs, the caller gets a 500.
To test a webhook from your own machine, n8n's common issues page gives curl commands for each case; replace the address with your own URL (n8n docs):
curl --request GET https://your-n8n.url/webhook/path
curl --request POST https://your-n8n.url/webhook/path --data 'key=value'
curl --request GET https://your-n8n.url/webhook/path --header 'key=value'
curl --request POST https://your-n8n.url/webhook/path --form 'key=@/path/to/file'Lock the production URL before you share it
Anyone who knows a webhook URL can call it, so treat an open one like an unlocked door. The node supports Basic auth, Header auth and JWT auth, set through a webhook credential (credential docs). It also has an IP(s) Allowlist option that answers any other address with a 403, and if n8n sits behind a reverse proxy you set N8N_PROXY_HOPS to the number of proxies so the allowlist sees the real caller (common issues).
Two options look like security and are not quite. Only Run If evaluates an expression against the request and answers non matching requests with a 200 and no execution, which is a good filter, but if the expression fails to evaluate n8n logs a warning and lets the request through (Webhook node docs). Allowed Origins, the list of cross origin domains allowed to call the URL, defaults to *, meaning all of them. Payloads are capped at 16MB, and self hosted instances can change that with N8N_PAYLOAD_SIZE_MAX.
For payment and account events, check the sender's signature as well. Stripe's own docs put the risk plainly: "Without verification, an attacker could send fake webhook events to your endpoint to trigger actions like fulfilling orders, granting account access, or modifying records" (Stripe webhooks docs). Stripe signs every event in a Stripe-Signature header and also publishes the IP addresses it sends from, and it recommends using both protections.

In n8n the easy path is the Stripe Trigger node rather than a plain Webhook node. Set a Signature Secret on the Stripe credential and the node checks the header itself, rejecting any request that is unsigned, forged or more than five minutes old with a 401, without running the workflow; without a secret, the docs warn, anyone who knows the URL could send forged events (Stripe Trigger docs). If you must use the generic node for a signing sender, switch on its Raw Body option, because Stripe "requires the raw body of the request to perform signature verification".
Finally, keep n8n patched, because the webhook is the part of it the internet can reach. CVE-2026-21858, titled "Improper Webhook Request Handling", let an unauthenticated attacker read files on the server through certain form based workflows; it scored 10.0 on CVSS, affected versions from 1.65.0 up to 1.121.0, and was fixed in 1.121.0 (CVE record). The advisory's stopgap for anyone who could not upgrade was to restrict or disable public webhook and form endpoints.
Answer fast, and expect the same event twice
Senders wait only so long for an answer. On n8n Cloud, a webhook that does not respond within 100 seconds fails with a 524, and n8n's suggested fix is two webhooks: one that starts the long job and answers at once, and one the caller can check for status (common issues). Stripe asks every endpoint to return a 2xx "before any complex logic that might cause a timeout", and counts timeouts, errors and even redirects as failed deliveries (Stripe webhooks docs).
So for event senders, set Respond to Immediately or put a Respond to Webhook node at the start, then do the slow work after. A failed delivery is not lost, though, which leads to the next problem: Stripe retries for up to three days in live mode, "webhook endpoints might occasionally receive the same event more than once", and Stripe does not guarantee events arrive in the order they happened (Stripe).
The fix is to make the workflow safe to run twice. Store the ID of every event you process, in a database table or a sheet, and check it before acting, which is exactly what Stripe recommends. Do not rely on arrival order: if a payment event arrives before the subscription it belongs to, fetch the missing record from the API instead of assuming it exists. And subscribe only to the event types the workflow needs, since every extra one is another execution to pay for and another branch to handle.
Self hosted behind a proxy, set the public webhook URL
On a self hosted n8n behind Nginx or another reverse proxy, the URLs in the node often show the wrong address. n8n builds the webhook URL from N8N_PROTOCOL, N8N_HOST and N8N_PORT, and it runs internally on port 5678 while the proxy serves the web on 443 (n8n reverse proxy docs). The fix is three steps: set the public URL, tell n8n how many proxies sit in front of it, and have the last proxy forward X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto.
export N8N_WEBHOOK_URL=https://n8n.example.com/
export N8N_PROXY_HOPS=1Older guides and most forum answers use WEBHOOK_URL. It is deprecated from n8n 2.35.0 but still works as an alias, with a warning in the log at startup (endpoint variables). The address must be public HTTPS for most senders: Stripe accepts only publicly accessible HTTPS URLs, and Telegram refuses anything else. Our guide to self hosting n8n on Google Cloud with Nginx and HTTPS sets both variables as part of the install.
A go live checklist for any n8n webhook
Run through this before you paste a production URL into another company's dashboard. Each item maps to a section above.
- The workflow is published and the sender has the production URL, the one with
/webhook/rather than/webhook-test/. - The URL is locked with header, basic or JWT auth, or the sender's signature is checked, ideally with the app's own trigger node.
- An IP allowlist is set where the sender publishes its addresses, with
N8N_PROXY_HOPSset behind a proxy. - The workflow answers within the sender's limit and does slow work after the response.
- Event IDs are stored and checked, so a retried event does nothing the second time.
- Only the event types you handle are switched on at the sender.
- n8n is on a version with the current security fixes.
- A test call with curl appears under Executions with the data you expect.
More n8n builds and fixes are in the n8n category, including how n8n compares with Zapier and Make for AI workflows. If you would rather have the webhook and the workflow behind it built and checked for you, that is part of our custom AI agents service.
Questions people ask
What is the difference between the n8n webhook test URL and production URL?
The test URL is registered when you click Listen for test event or Execute workflow, listens for 120 seconds and shows incoming data in the editor. The production URL is registered when you publish the workflow, keeps listening until you unpublish it, and records each run under the workflow's Executions tab instead of the canvas. By default the test path contains webhook-test and the production path webhook.
Why does an n8n webhook only work when you click Execute workflow?
Because the sending app has the test URL, which only listens for 120 seconds after you start listening in the editor. Copy the production URL from the node, give that to the sender, and publish the workflow. Production runs do not appear on the canvas, so check the Executions tab to see them.
How do you secure an n8n webhook?
Add authentication on the node (header, basic or JWT), set an IP allowlist when the sender publishes its addresses, and verify the sender's signature for payment or account events. For Stripe, the Stripe Trigger node does the signature check when you set a Signature Secret on the credential. Keep n8n updated, since CVE-2026-21858 was a critical flaw in webhook request handling.
What is the difference between the n8n Webhook node and the HTTP Request node?
They point in opposite directions. The Webhook node waits for other apps to call your workflow, so it starts a workflow when something happens elsewhere. The HTTP Request node lets your workflow call out to any app or service with a REST API, to fetch or send data. Many workflows use both: a webhook to start, HTTP requests to act.
How do you change the n8n webhook URL when self hosting?
Set N8N_WEBHOOK_URL to your public HTTPS address and N8N_PROXY_HOPS to the number of reverse proxies in front of n8n, then restart. The older WEBHOOK_URL still works as an alias but is deprecated from n8n 2.35.0. Without it, n8n builds the URL from its own protocol, host and port, which behind a proxy shows the internal address.
Sources
- Webhook node, n8n docs
- Webhook node common issues, n8n docs
- Respond to Webhook node, n8n docs
- Configure webhook URLs with reverse proxy, n8n docs
- Endpoints environment variables, n8n docs
- Webhook credentials, n8n docs
- Stripe Trigger node, n8n docs
- WhatsApp Trigger node, n8n docs
- n8n pricing
- Receive Stripe events in your webhook endpoint, Stripe docs
- CVE-2026-21858, CIRCL CVE search
- HTTP Request node, n8n docs