Skip to content
New: a free website for your business, live in 48 to 72 hoursWorkflow automation on n8n and Claude, built for your businessFixed price, agreed before we start · Live in 5 to 10 business days30-day money-back guarantee on every planProfessional firms · Agencies · E-commerceYou own every workflow, in your own n8nClaude API: your data is not used for trainingHuman approval on every sensitive stepFree automation audit, no obligation
PURIST
30 days
Money-back window
14 h/wk
Modeled time saved
99.97%
Uptime SLA
< 7 days
Deploy time
PURIST AI
Claude Opus 4.7 · n8n v1.71 · <80ms
What type of business are you running? I'll show you exactly which processes we'd automate first and your estimated ROI.
Powered by n8n + Claude Opus 4.7 Get my free automation plan →
n8n Webhook URL: Test vs Production, and How to Change It
Guides 6 min read · 1,211 words

n8n Webhook URL: Test vs Production, and How to Change It

Every n8n Webhook node has two URLs. When to use each, how to set a clean path, and how to make self-hosted n8n show your real domain instead of localhost.

Steve, founder of PURIST

November 6, 2026

PURIST: Stuck on n8n? Our n8n experts fix and build workflows like this one, at a fixed price →

An n8n webhook URL is built from three parts: the base address of your instance, an endpoint segment that differs between test and production, and the path you choose. Get one of them wrong and external services cannot reach your workflow. Here is how each part works and how to control it.

In short. Test URLs contain /webhook-test/ and listen for 120 seconds after "Listen for test event". Production URLs contain /webhook/ and listen while the workflow is published. Set a readable custom path in the node. On self-hosted n8n behind a proxy, set N8N_WEBHOOK_URL to your public address and N8N_PROXY_HOPS=1, then restart.

n8n Webhook URL: Test vs Production, and How to Change It: workflow diagram
Behind a reverse proxy, N8N_WEBHOOK_URL tells n8n its public address. Illustration: PURIST.

Anatomy of a webhook URL

text
https://n8n.example.com/webhook-test/new-lead   <- Test URL
https://n8n.example.com/webhook/new-lead        <- Production URL
\_____ base URL ______/\_ endpoint _/\_ path _/
PartControlled byDefault
Base URLInstance configuration (N8N_WEBHOOK_URL)Built from protocol, host and port
EndpointN8N_ENDPOINT_WEBHOOK and N8N_ENDPOINT_WEBHOOK_TESTwebhook and webhook-test
PathThe Path field of the Webhook nodeA random ID

Test URL or Production URL?

Use the Test URL while building: n8n shows the incoming data in the editor, which is what you need to map fields. It only listens for 120 seconds after you click "Listen for test event".

Use the Production URL for every real integration: forms, payment providers, CRMs. It listens as long as the workflow is published. Its executions do not appear on the canvas; open the Executions tab.

A common mistake is to configure Stripe or a form tool with the Test URL during setup and forget to switch. The integration then works only when you happen to be listening.

n8n Webhook URL: Test vs Production, and How to Change It: node settings
Test and Production URLs with a stable path and route parameters. Illustration: PURIST.

Change the path

The path field is random by default to avoid conflicts. Replace it with something stable and readable, such as new-lead or stripe/payment-succeeded. The documentation also allows route parameters:

text
/:variable
/path/:variable
/:variable/path
/:variable1/path/:variable2

A request to /webhook/orders/812 on the path orders/:id makes 812 available in the node's output under params. Remember the rule: one webhook per path and HTTP method across the instance.

Fix a localhost URL on self-hosted n8n

If the node shows http://localhost:5678/webhook/... while your instance lives at https://n8n.example.com, the base URL is wrong. n8n builds it from N8N_PROTOCOL, N8N_HOST and N8N_PORT. Behind a reverse proxy (Nginx, Caddy, Traefik, Cloudflare Tunnel) n8n runs internally on port 5678 while the world reaches it on 443, so it cannot guess the right address. The documented fix:

bash
export N8N_WEBHOOK_URL=https://n8n.example.com/
export N8N_PROXY_HOPS=1

In Docker Compose:

yaml
services:
  n8n:
    image: n8nio/n8n
    environment:
      - N8N_WEBHOOK_URL=https://n8n.example.com/
      - N8N_PROXY_HOPS=1

N8N_WEBHOOK_URL replaces WEBHOOK_URL, deprecated from n8n 2.35.0. The old name still works but logs a warning. Your proxy must also forward the X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto headers. Restart n8n, reopen the Webhook node, and the URLs show your domain.

Change the endpoint segment

If you need /hooks/ instead of /webhook/, set N8N_ENDPOINT_WEBHOOK (production) and N8N_ENDPOINT_WEBHOOK_TEST (test). Changing them breaks every URL already configured in external tools, so do it before going live, not after.

Testing locally

On a laptop, external services cannot reach localhost. The documentation recommends running n8n in tunnel mode for development, or you can use any tunnel service and point N8N_WEBHOOK_URL at the public tunnel address. Never use a development tunnel for production traffic.

Worked example: Nginx in front of n8n

A typical self-hosted setup: n8n listens on port 5678 inside Docker, and Nginx terminates HTTPS on 443 for n8n.example.com.

Nginx server block (excerpt):

nginx
location / {
    proxy_pass http://127.0.0.1:5678;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    client_max_body_size 16m;
}

n8n environment:

yaml
environment:
  - N8N_HOST=n8n.example.com
  - N8N_PROTOCOL=https
  - N8N_WEBHOOK_URL=https://n8n.example.com/
  - N8N_EDITOR_BASE_URL=https://n8n.example.com/
  - N8N_PROXY_HOPS=1

The Upgrade and Connection headers keep the editor's live connection working through the proxy. client_max_body_size matches n8n's default 16 MB webhook payload; raise both together if you need larger uploads.

After restarting, open any Webhook node: both URLs should start with https://n8n.example.com/.

Cloudflare Tunnel and other tunnels

A tunnel gives your instance a public hostname without opening ports. The same rule applies: n8n does not know that hostname until you set N8N_WEBHOOK_URL to it. For development tunnels whose address changes at every start, update the variable and every sender each time, which is why they suit testing only.

Naming paths so they last

Path styleExampleVerdict
Random default/webhook/4f1c9a7e-...Safe from collisions, impossible to recognise
Purpose/webhook/new-leadReadable, stable
Source and event/webhook/stripe/payment-succeededBest when several senders exist
Route parameter/webhook/orders/:idFor API-style endpoints

Write the path and the sender next to each other in the workflow notes, so the next person knows which tool calls it.

Troubleshooting table

SymptomLikely causeFix
URLs show localhost:5678No public URL configuredSet N8N_WEBHOOK_URL and restart
URLs show http instead of httpsProtocol not set behind a TLS proxySet N8N_PROTOCOL=https and the full https URL
Warning about WEBHOOK_URL in the logsDeprecated name since 2.35.0Rename to N8N_WEBHOOK_URL
IP allowlist blocks everythingn8n sees the proxy IPSet N8N_PROXY_HOPS to the number of proxies
Large uploads fail with 413Proxy body limit lower than n8n'sRaise client_max_body_size (and N8N_PAYLOAD_SIZE_MAX)

Production checklist

  • N8N_WEBHOOK_URL set to the public URL, N8N_PROXY_HOPS set behind a proxy.
  • Proxy forwarding X-Forwarded-For, X-Forwarded-Host and X-Forwarded-Proto.
  • Stable custom paths documented next to each integration.
  • No development tunnel used for production traffic.

Frequently asked questions

What is the difference between webhook and webhook-test in n8n URLs?

/webhook-test/ is the Test URL, active for 120 seconds after "Listen for test event", with data shown in the editor. /webhook/ is the Production URL, active while the workflow is published.

How do I change the n8n webhook URL from localhost to my domain?

Set N8N_WEBHOOK_URL to your public URL (for example https://n8n.example.com/), set N8N_PROXY_HOPS=1 behind a reverse proxy, and restart n8n.

Is WEBHOOK_URL still valid in n8n?

It still works but is deprecated from n8n 2.35.0. Use N8N_WEBHOOK_URL.

Does changing the path break existing integrations?

Yes. External services keep calling the old URL. Update them, or keep the old path.

Can I use a custom domain for n8n Cloud webhooks?

Use the URL shown in your Cloud workspace. Custom domains depend on your plan; check the n8n Cloud settings for your workspace.

Does N8N_WEBHOOK_URL change the editor address?

No. It sets the webhook base URL. The editor's public address is N8N_EDITOR_BASE_URL, which is also used for OAuth redirect URLs.

Do test and production webhooks share the same path?

Yes. They differ by the endpoint segment: /webhook-test/ versus /webhook/.

Tags

n8nwebhookself-hostedreverse proxydocker
Steve, founder of PURIST

Steve founded PURIST, a workflow automation studio working with n8n, Make and Claude AI, and is the point of contact on every project. Prices and features in our articles come from vendor documentation and public pricing pages. How we research and score tools.

Complete guide

Automation Tools & Platforms

11 min read n8n Code Node: 15 JavaScript Examples You Can Copy and … 8 min read n8n Code Node With Multiple Inputs: 3 Methods That Work 7 min read Fix "Cannot find module" in the n8n Code Node (npm Pack… 7 min read n8n Code Node Errors Fixed: "Code doesn't return items … 7 min read $env and Credentials in the n8n Code Node: What Works a… 7 min read n8n Code Node Binary Data: Read, Change and Return File… 7 min read Python in the n8n Code Node (n8n 2.x): Setup, Syntax an… 7 min read Fix n8n "The requested webhook is not registered" (Test… 7 min read n8n Respond to Webhook: Return JSON, Status Codes, Redi… 8 min read Secure an n8n Webhook: Header Auth, Basic Auth, JWT and… 7 min read n8n Webhook Not Working? 10 Causes and How to Fix Each … 7 min read n8n HTTP Request Pagination: Every Pattern With Working… 7 min read n8n HTTP Request Authentication: API Keys, Bearer Token… 7 min read n8n HTTP Request Timeout and "Aborted" Errors: Causes a… 7 min read Upload and Download Files With the n8n HTTP Request Nod… 6 min read Fix ECONNREFUSED in n8n: Docker, localhost and 127.0.0.… 6 min read n8n 429 Too Many Requests: Batching, Retries and Rate L… 6 min read Fix redirect_uri_mismatch for n8n OAuth2 Credentials (G… 7 min read n8n Expression Errors Fixed: "Referenced node is unexec… 6 min read Anatomy Claude skill: what it is, how to install it, an… 5 min read How to explain a business process with the Anatomy skil… 5 min read Anatomy vs Mermaid vs Excalidraw: which to explain a wo… 14 min read n8n LinkedIn Job Automation: Auto-Apply, Track, and Fol… 16 min read n8n HTTP Request Node: Complete Documentation and Examp… 18 min read The future of automation: how our engineering team is s… 8 min read n8n vs Make vs Zapier: the honest comparison your busin… 11 min read n8n vs Make vs Zapier: an honest comparison for product… 7 min read Webhook vs polling: the architecture decision that dete… 24 min read n8n tutorial: build your first production workflow in u… 26 min read The 9 best Zapier alternatives in 2026: an honest ranki… 21 min read Make.com tutorial: build powerful automations without c… 19 min read Automation consultant vs DIY: how to decide what is rig… 14 min read n8n Self-Hosted vs Cloud: The Complete Decision Guide (… 15 min read 5 Zapier Free Alternatives That Handle Real Production … 15 min read WhatsApp Business Automation With n8n: Build a 24/7 Cus… 17 min read Google Workspace Automation: 15 Workflows for Sheets, D… 16 min read Claude AI for Business Automation: What It Does, What I… 15 min read Airtable Automation With n8n: 10 Workflows That Make Yo… 15 min read Droven.io AI Automation Tools: Full Review and Best Alt… 14 min read Droven.io RPA and Business Automation: An Honest 2026 R… 15 min read Enterprise Workflow Automation: The Complete Guide for … 13 min read Document Workflow Automation: Software, Implementation,… 14 min read Marketing Automation Workflow: From Content Creation to… 16 min read Ad Campaign Workflow Data Model and SDR Inbound Pipelin… 14 min read ComfyUI Workflows for Business: Product Photography, Ma… 13 min read GPT-5.2 for Business Workflows and the spec-workflow-mc… 17 min read ServiceNow vs IBM BAW vs n8n: Enterprise Workflow Autom… 16 min read 9 Best Workflow Automation Tools for Small Business in …

Keep reading

More from the blog.

All articles

From audit to deployment

Experience the automation
these articles are about.

Get my free automation plan →