How to Use Webhooks in n8n (Trigger and Respond)

Set up the n8n Webhook node step by step: test vs production URLs, Header auth, Respond to Webhook replies, payload limits and the fixes for common webhook errors.

Summarize this post with AI

A 25-minute read, or the key points in about 30 seconds, in the assistant you already use.

Opens in a new tab with the prompt filled in. Nothing passes through this site.

An n8n webhook gives you two URLs, and only one of them works after you close the editor. The test URL listens for 120 seconds. The production URL doesn't exist until you publish the workflow.

Mix them up and your form, payment app or script sends data to an address nobody is listening on.

Here's the catch most tutorials skip. After you publish, production runs the version you published, not the edits you made afterwards. You can fix a bug, test it, see it pass, and still ship the old behaviour.

This guide sets up the Webhook node step by step: test vs production URLs, authentication, and the right way to send a response back. Then the limits that cause timeouts. New to the idea itself? Start with how a webhook works under the hood.

Every setting below comes from n8n's official docs. Some links here are affiliate links. They don't change your price.

Editorial cover showing an incoming request arriving at a glowing n8n webhook node that starts a three-node workflow, with an arc looping from the end of the workflow back to the sender
A webhook in n8n does two jobs: it starts the workflow, and it can answer the caller.

What does the n8n Webhook node do?

The Webhook node is a trigger. It gives your workflow a URL, and any app that sends an HTTP request to that URL starts a run with the request data. n8n's docs pitch it for services "that don't have a dedicated app trigger node".

It can also answer. The node can return data from the end of the workflow, so a workflow can behave like a small API endpoint. If the request and response idea is fuzzy, my explainer on what an API is and how it works covers it in plain English.

Five settings decide almost everything:

SettingWhat it controlsOptions (per n8n docs)
Webhook URLsWhere callers send requestsTest URL and Production URL
HTTP MethodWhich request type it acceptsDELETE, GET, HEAD, PATCH, POST, PUT
PathThe end of the URLRandom by default, or your own, with route parameters
AuthenticationWho is allowed to call itNone, Basic auth, Header auth, JWT auth
RespondWhat the caller gets back, and whenImmediately, When Last Node Finishes, Using Respond to Webhook node, Streaming

My take: the URL and the Respond setting cause most of the trouble. Authentication is the one people skip, and it's the one that costs money later.

What's the difference between the test and production webhook URL?

The test URL is for building. The production URL is for real traffic. They are different addresses, they register at different moments, and they show their data in different places.

Test URLProduction URL
Default path segment (self-hosted)/webhook-test//webhook/
How it starts listeningClick Listen for test event (or Execute workflow)Publish the workflow
How long it listens120 secondsUntil you unpublish the workflow
Where you see the dataLive in the editorIn the workflow's Executions tab
Use it forBuilding and debuggingReal callers

The path segments come from n8n's endpoint settings, where the defaults are webhook for production and webhook-test for testing. Copy the URL from the node itself rather than typing it, because the toggle at the top of the node panel decides which one you're looking at.

Diagram comparing the n8n test webhook URL, marked with a timer and leading to the editor, with the production URL, marked with a power icon and leading to the executions list
Test URL for building, production URL for real traffic. Most webhook bugs are the wrong one in the wrong place.

Why does the production URL keep running old logic?

Because publishing locks a version. n8n's docs say it directly: "Production executions will use this published version, not your latest edits." Your edits auto-save, but they stay in draft until you publish again.

So the workflow can be published and still out of date. n8n's Publish button shows this state as "Published, has changes". If a fix works on the test URL but not in production, look at that button before you touch anything else.

How do you set up a webhook in n8n, step by step?

Here's the setup for a typical job: a website form or app posts JSON to n8n, and n8n replies with a small confirmation.

Step 1: Add the Webhook node and pick the method

Create a workflow and add the Webhook node as the trigger. Set HTTP Method to POST for anything that sends data, because the data travels in the request body.

Need one URL to accept both GET and POST? Open the node's Settings and turn on Allow Multiple HTTP Methods. The node then gets one output per method, so each method can take its own branch.

Step 2: Give it a readable path

By default the Path is a random string, which n8n uses "to avoid conflicts with other webhook nodes". Replace it with something you'll recognise in six months, like new-lead.

Paths can carry route parameters, such as /orders/:orderId. n8n allows only one webhook per path and method combination, so two workflows can't both listen on POST /new-lead. If n8n says the path is in use, change the path or unpublish the other workflow.

Step 3: Turn on authentication

Set Authentication to Header auth and create the credential with a header name and a long random value. The caller then sends that header with every request. Anything without it is rejected before your workflow runs.

Skip this step only for throwaway tests. A public URL with no auth will run your workflow for anyone who finds it, and every run counts against your plan.

Step 4: Choose how n8n responds

For this job, set Respond to Using 'Respond to Webhook' Node. That lets you choose the exact JSON and status code later in the flow. The next section explains when the other options are a better fit.

Step 5: Send a test request

Click Listen for test event, then send a request within 120 seconds. From a terminal:

bash
curl -X POST "PASTE-THE-TEST-URL-HERE" \
  -H "Content-Type: application/json" \
  -H "X-Webhook-Key: your-long-random-value" \
  -d '{"email": "ana@example.com", "plan": "pro"}'

The header name and value must match your Header auth credential. The request appears in the editor, and every later node can read it. Your data sits under body, so the email is available with this expression:

text
{{ $json.body.email }}

Headers, query strings and route parameters work the same way, under $json.headers, $json.query and $json.params.

Step 6: Publish and switch to the production URL

Add the rest of the workflow, end it with a Respond to Webhook node, and test again. Then click Publish, flip the node's URL toggle to Production URL, and paste that URL into the app that will call it.

Send one real request and open it in the Executions tab. Production data never shows up live in the editor, so that tab is where you confirm the run.

Which Respond option should you pick?

The Respond setting decides when the caller gets an answer and what's in it. Pick it based on who is calling and how long the workflow takes.

Respond optionWhat the caller getsPick it when
ImmediatelyYour response code and the message "Workflow got started"The sender only needs a quick acknowledgement, like most app event webhooks
When Last Node FinishesData from the last node that ranA simple workflow should return its final result as-is
Using Respond to Webhook nodeExactly what that node sends, at the point it runsYou need custom JSON, a status code, headers or a redirect
Streaming responseData streamed as the workflow runsAn AI Agent or another streaming node is answering a chat-style request

My rule: app-to-app event webhooks get Immediately, and anything that needs an answer gets Respond to Webhook. When Last Node Finishes is fine for quick prototypes, but it couples your response to whichever node happens to run last.

Diagram of four n8n webhook response modes as lanes: Immediately replies at the start, Last node replies after the final node, Respond node replies from a highlighted node mid-workflow, and Streaming sends output as a stream of dots
The Respond setting decides when the caller hears back. Slow workflows should answer early.

How does the Respond to Webhook node work?

Add it after the nodes whose data you want to return. Respond With offers All Incoming Items, Binary File, First Incoming Item, JSON, JWT Token, No Data, Redirect and Text. Text sends HTML by default, with Content-Type text/html. Under Add Option you can set the Response Code and Response Headers.

A JSON response for the form example might look like this:

text
Respond With:   JSON
Response Code:  200
Response Body:  { "ok": true, "email": "{{ $json.body.email }}" }

Four behaviours from n8n's docs are worth knowing before you go live:

What happensWhat the caller gets
The workflow finishes without reaching Respond to WebhookA standard message with status 200
The workflow errors before Respond to Webhook runsAn error message with status 500
A second Respond to Webhook node runsNothing new. n8n ignores it
The node runs once with many itemsOnly the first item, unless you pick All Incoming Items

The node runs once, using the first item. To return a list, choose All Incoming Items, or put an Aggregate node set to All Item Data (Into a Single List) in front of it.

One more trap. Since n8n 1.103.0, HTML responses are wrapped in a sandboxed iframe. Scripts can't reach the parent window or local storage, and relative links like a form posting to / stop working. Use absolute URLs.

How do you secure an n8n webhook?

Start with authentication on the node, then narrow who can call it. n8n gives you four layers, and they stack.

LayerWhat it checksGood for
Header authA secret header name and valueYour own apps, scripts and websites' back ends
Basic authA username and passwordTools that only support basic auth
JWT authA signed JSON Web Token (Passphrase or PEM Key)Callers that already issue JWTs
IP(s) Allowlist optionThe caller's IP address. Others get a 403Senders that publish fixed IP ranges

Behind a reverse proxy, the allowlist only sees the proxy's IP unless N8N_PROXY_HOPS is set to the number of proxies in front of n8n. n8n's common-issues page calls this out.

Diagram of layered n8n webhook security: an incoming request passes IP allowlist, Auth and Signature gates before it reaches the workflow, while a rejected request drops out at the first gate
Each layer rejects a different kind of bad request. The more public the URL, the more layers it needs.

What about services that sign their webhooks?

Many senders don't send a header you choose. They sign each delivery instead. GitHub, for example, sends an X-Hub-Signature-256 header holding an HMAC hex digest of the payload, made with your shared secret and prefixed with sha256=.

The Webhook node's auth options don't include signature checks, but n8n's Crypto node has an Hmac action with SHA256 and HEX encoding. The pattern is: turn on the Webhook node's Raw Body option so you hash the exact bytes the sender signed, compute the HMAC with the Crypto node, then compare it with the header in an If node and stop the run on a mismatch.

Test that chain against a real delivery from the sender before you trust it. GitHub also recommends a constant-time comparison, which a plain If node equality check isn't. For most small workflows that trade-off is acceptable. For payment data, I'd put the check in your own code instead.

Can n8n ignore junk requests for free?

Yes. The Only Run If option, under Add Option, runs an expression against the incoming request. If it returns false, n8n answers with a 200 and doesn't create an execution. On n8n Cloud, where you pay per execution, that's the cheapest filter you have.

text
Only Run If:  {{ $json.body.event === 'order.created' }}

It runs after the IP allowlist and authentication checks. One caveat from the docs: if the expression fails to evaluate, n8n logs a warning and lets the request through. Keep the expression simple, and don't treat it as a security control.

Two smaller options round this out. Ignore Bots drops link previewers and crawlers, which matters when someone pastes your URL into a chat app. Allowed Origins (CORS) defaults to *, so set it to your own domain if a browser calls the webhook directly.

What limits should you know before going live?

These are the numbers that decide whether a webhook works under real traffic. All come from n8n's docs and pricing page, as of 25 October 2026.

LimitValueWhat to do about it
Max payload16 MBSelf-hosted: raise N8N_PAYLOAD_SIZE_MAX (in MiB) and restart, at the cost of more memory and CPU
Files in form-data payloads200 MiB defaultSelf-hosted: N8N_FORMDATA_FILE_SIZE_MAX
n8n Cloud response timeout100 seconds, then a 524 errorRespond early, or split into a start webhook and a status webhook
Max execution duration5 min on Starter, 40 min on ProRespond early and keep runs short, or self-host
Test URL listening window120 secondsClick Listen for test event again
Webhooks per path and methodOneChange the path or method, or unpublish the clash

Senders have their own clocks too. GitHub expects a 2XX response within 10 seconds and treats anything slower as a failed delivery. That's why Immediately is the safe choice for event webhooks: acknowledge first, then do the slow work in the same run.

How much does a webhook cost on n8n Cloud?

Each request that starts a run is one execution, however many nodes the workflow has. n8n prices Cloud by executions: Starter is €20 a month billed annually for 2,500 executions, and Pro is €50 a month for 10,000.

So a form getting 100 submissions a day uses about 3,000 executions a month, which is already past Starter. Filter junk with Only Run If, and compare plans in my n8n Cloud vs self-hosted pricing breakdown before you wire up a busy sender.

Retries can double-count. Most senders resend when they don't get a 2XX in time, so the same event can arrive twice. n8n's Remove Duplicates node, set to Remove Items Processed in Previous Executions with Value Is New on the event ID, drops repeats before they create a second record.

What usually goes wrong with n8n webhooks?

Most failures fall into a handful of patterns. Here's the symptom, the usual cause and the fix.

SymptomLikely causeFix
Test request does nothingThe 120-second listener expiredClick Listen for test event, then send again
Production URL returns an errorThe workflow isn't publishedPublish it and check the button state
Fix works in test, not in productionProduction runs the last published versionPublish again. Look for "Published, has changes"
No data visible after a real requestProduction runs only show in ExecutionsOpen the Executions tab
Caller gets a 524 on n8n CloudResponse took over 100 secondsRespond Immediately or use a Respond to Webhook node early
Caller gets a 500The workflow errored before Respond to Webhook ranFix the failing node and add an error workflow
Allowlisted IP gets a 403n8n sees the proxy's IPSet N8N_PROXY_HOPS
URL shows localhostMissing public base URLSet N8N_WEBHOOK_URL

For the 500 case, add an error workflow with the Error Trigger node, so a failed run sends you an alert instead of failing silently.

Building on your own laptop? n8n's docs offer a tunnel mode for local webhooks, and they're clear that it's for development only and "isn't safe to use it in production".

For real traffic, run n8n on Cloud or on a server. My walkthrough on how to self-host n8n on a VPS with Docker covers the domain, SSL and webhook URL settings. If you go that route, I recommend a Hostinger KVM VPS for self-hosting tools like n8n.

What can you build once the webhook works?

Almost every useful n8n workflow starts with a trigger, and a webhook is the most flexible one. Common jobs: form submissions into a CRM, payment events into a spreadsheet, a Slack slash command that returns data, or an AI agent behind your own chat box.

That last one combines everything above: Header auth, a Respond to Webhook node and a session ID. I walk through it in how to build an AI agent in n8n. For more ideas, my list of n8n workflow examples that actually ship has thirty.

Frequently asked questions

Why is my n8n webhook not working?▾
Usually it's the wrong URL for the moment. The test URL only listens for 120 seconds after you click Listen for test event, and the production URL only works once the workflow is published. Check which URL the caller uses, then check the Publish button state.
How long does the n8n test webhook stay active?▾
120 seconds, according to n8n's workflow development docs. Click Listen for test event again to reopen it. The production URL stays active until you unpublish the workflow.
How do I return a custom response from an n8n webhook?▾
Set the Webhook node's Respond option to Using 'Respond to Webhook' Node, then add a Respond to Webhook node. Choose JSON, Text, Binary File, Redirect or another Respond With option, and set the Response Code and Response Headers under Add Option.
What is the maximum payload size for an n8n webhook?▾
16 MB by default. On self-hosted n8n you can raise it with the N8N_PAYLOAD_SIZE_MAX environment variable and a restart, but bigger payloads need more memory and CPU. File uploads in form-data have a separate 200 MiB default.
Can one n8n webhook accept both GET and POST?▾
Yes. Open the Webhook node's Settings and turn on Allow Multiple HTTP Methods. It accepts GET and POST by default, you can add more methods, and each method gets its own output on the node.
Does every webhook call count as an n8n execution?▾
Every call that starts a run does. Requests rejected by authentication or the IP allowlist are stopped before the workflow runs, and requests filtered out by the Only Run If option get a 200 without creating an execution, per n8n's docs.

Start with Header auth and a Respond to Webhook node, even for a small workflow. Adding them later means changing every app that already calls the URL. If you don't want to run a server, n8n Cloud hosts the webhook URL for you, so there's no domain, SSL or proxy to manage.

Share