n8n / Triggers
Receive data with webhooks
Use the Webhook node to start n8n workflows from websites, forms and other apps, test safely, secure the URL and send a response back.
Intermediate 12 min Updated
A webhook is a URL that another system calls when something happens: a form is submitted, a payment succeeds, a deal changes stage. The Webhook node gives your workflow such a URL. It is the most flexible trigger in n8n, because almost every app and website can send data to a URL.
How it works
- You add a Webhook node and n8n generates a URL.
- You paste that URL into the other app, often in a section called Webhooks or Integrations.
- The app sends an HTTP request with data (usually JSON) whenever the event happens.
- n8n starts the workflow with that data as the first item.
Test URL and production URL
Every Webhook node has two URLs. You switch between them at the top of the node.
| Test URL | Production URL | |
|---|---|---|
| Path contains | /webhook-test/ | /webhook/ |
| Works when | You select Listen for test event, for about two minutes | The workflow is published |
| Data shown on canvas | Yes | No, check the Executions tab |
| Use for | Building and debugging | The real integration |
Warning: The most common webhook problem is a live app still pointing at the test URL. When you go live, copy the production URL into the other app.
Step 1: Add and configure the node
- Create a workflow and add the Webhook node as the trigger.
- Set HTTP Method to what the sender uses. Most apps send
POST. - Change Path to something readable, such as
new-lead. The default is a random string, which is fine too. - Choose how to Respond (see below).
Step 2: Send a test request
-
Select Listen for test event.
-
Trigger the event in the other app, or send a request yourself:
curl -X POST "https://your-n8n-domain/webhook-test/new-lead" \ -H "Content-Type: application/json" \ -d '{"name": "Jane", "email": "jane@example.com", "source": "website"}' -
The node shows the received data. You find the JSON body under
body, and alsoheadersandquery. -
Pin the output and build the rest of the workflow.
Step 3: Choose a response
The sender usually waits for an answer. Under Respond you choose:
- Immediately: n8n answers right away that the workflow started. Best for most integrations, because senders often time out after a few seconds.
- When Last Node Finishes: n8n answers with the output of the last node. Useful for simple APIs.
- Using ‘Respond to Webhook’ Node: you decide exactly what to send back, and when, with a separate node. Good for redirects after a form, or custom status codes.
- Streaming: sends the answer piece by piece, for example from an AI Agent.
Step 4: Secure the webhook
Anyone who knows the URL can call it. Protect it:
- Set Authentication to Header Auth and choose a long random secret. Configure the sender to include that header. Basic Auth and JWT are also available.
- Use IP(s) Allowlist under options if the sender has fixed IP addresses.
- Turn on Ignore Bots for URLs that might get shared, so link previews do not trigger runs.
- Validate the data early in the workflow. Stop when required fields are missing.
Note: Some apps sign their webhooks instead of sending a fixed header. Check the app’s documentation. You can verify a signature with a Code node or the Crypto node.
Step 5: Publish and connect
- Click Publish.
- Copy the Production URL into the other app.
- Trigger one real event and check the Executions tab.
Webhooks from your website
Static sites, such as our Astro sites, can post form submissions straight to an n8n webhook. Then n8n can store the lead, notify you and send a confirmation email. See Add forms to a static site.
For a simple form without a website, the n8n Form Trigger is easier: it hosts the form for you. See Build your first workflow.
Self-hosted tips
- The URL must be reachable from the internet. A workflow on
localhostcannot receive webhooks from online apps. - Behind a reverse proxy, set the
WEBHOOK_URLenvironment variable to your public address. Otherwise n8n shows the wrong URL in the node. - The maximum payload is 16 MB by default. Self-hosted instances can change this.
Next steps
Still stuck?
Send us what you tried and a screenshot, and we will help you further. For new projects, book a strategic call.
Strategic call