
n8n Webhook Node: Complete Tutorial with Examples (2026)
Quick Summary
- •The Webhook node listens for incoming HTTP requests and starts your n8n workflow
- •Use Production trigger mode to accept live webhook calls, Main mode for testing
- •Always validate incoming payloads and secure webhooks with auth tokens or IP allowlisting
- •Synta can generate complete webhook workflows from plain English descriptions
n8n Webhook Node: Complete Tutorial with Examples (2026)
- The Webhook node listens for incoming HTTP requests and starts your n8n workflow
- Use "Main" vs "Production" modes to control when workflows run
- Always validate incoming payloads before processing them
- Synta can generate complete webhook workflows from plain English descriptions
Introduction
The n8n Webhook node is one of the most powerful triggering mechanisms in n8n. It lets any external app, service, or even a simple cURL command start your workflow on demand. Whether you are receiving a Stripe payment notification, a form submission from Typeform, or a custom event from your own app, the Webhook node is the entry point that connects the outside world to your n8n automations.
This guide covers everything you need to know about the n8n Webhook node: how it works, how to configure it, common gotchas, and real examples you can copy and paste today.
**n8n** is an open-source workflow automation tool that lets you connect apps and automate tasks. Synta builds on top of n8n by generating production-ready workflows from plain English descriptions, so you can skip the configuration and deploy faster.
How Does the n8n Webhook Node Work?
**The n8n Webhook node listens for incoming HTTP requests at a unique URL and triggers your workflow when one arrives. When a request hits the webhook URL, n8n captures the request method (GET or POST), headers, query parameters, and body, then passes this data to the next node in your workflow.**
When you add a Webhook node to an n8n workflow, n8n generates a unique URL for that workflow. This URL accepts HTTP requests from any source. The node can handle GET requests (typically for confirmation or testing) and POST requests (for sending data). When the request arrives, n8n wakes the workflow, passes the request data as the workflow's initial payload, and runs the subsequent steps.
The generated webhook URL follows this pattern:
```
https://your-n8n-instance/webhook/workflow-id
```
If you are using n8n.cloud, n8n provides a public URL automatically. For self-hosted n8n instances, you need to configure your reverse proxy (like Nginx or Caddy) to forward requests to n8n.
How Do I Set Up an n8n Webhook Node?
**To set up an n8n Webhook node, add the node to your canvas, select the trigger type (Main or Production), choose the HTTP method, and copy the generated webhook URL to use in your external service.**
Here is the step-by-step process:
Step 1: Add the Webhook Node
Open your n8n canvas and add a new node. Search for "Webhook" and select the Trigger version (not the regular Webhook node, which is used for intermediate steps in a workflow).
Step 2: Select the Trigger Mode
n8n gives you two modes:
- **Main**: The workflow runs only when you manually click "Test workflow" in the n8n editor. Use this while building and testing.
- **Production**: The workflow is accessible via the public webhook URL and runs automatically when triggered. Use this when you are ready to go live.
Step 3: Choose the HTTP Method
Select GET, POST, or Both depending on what your external service sends. Most integrations use POST for sending data.
Step 4: Copy the Webhook URL
Once the node is configured, n8n shows the webhook URL. Copy it and add it to your external service as the callback or webhook URL.
Step 5: Add a Test Step
Before deploying to Production mode, test your workflow using the Main mode. Send a test request and verify the data arrives correctly in the next node.
What Webhook Response Options Does n8n Support?
**n8n Webhook nodes can return any HTTP status code (200 for success, 400 for bad request, 401 for unauthorized, 500 for server error) along with a JSON body, plain text, or an empty response. You configure this directly in the Webhook node settings.**
By default, the Webhook node returns a 200 OK response with `{ "success": true }`. You can customise this by connecting a Respond to Webhook node after your processing steps. This is useful when:
- You want to return a custom confirmation message to the calling app
- You need to return data from your workflow (like a transformed record)
- You want to return an error code if processing fails
The Respond to Webhook node must be the last node in your workflow, as n8n sends the response immediately when it reaches this node.
Common n8n Webhook Gotchas and How to Fix Them
**The most common n8n Webhook issues are: workflows not triggering because they are in Main mode instead of Production mode, payload validation failures from missing Content-Type headers, and webhook URLs expiring on n8n.cloud after 60 minutes of inactivity.**
Here is a breakdown of each issue and its solution:
Gotcha 1: Workflow in Main Mode
Many users build their workflow, set up the webhook URL in their external app, and then the webhook never fires. This is almost always because the workflow is still in Main trigger mode. Only workflows in Production trigger mode respond to external webhook calls.
**Fix:** Toggle the Webhook node to Production mode before going live. Always test in Main mode first.
Gotcha 2: Content-Type Header Missing
If you are sending a POST request with a JSON body, your request must include the header `Content-Type: application/json`. Without this header, n8n may not parse the body correctly.
**Fix:** Ensure your sending service sets the correct Content-Type header. You can verify this in the Webhook node's output by checking the `contentType` field.
Gotcha 3: Payload Validation Fails
n8n.cloud validates incoming webhook payloads by default. If the request does not pass validation, n8n rejects it before your workflow even runs.
**Fix:** For n8n.cloud, you may need to configure the webhook to accept any request, or ensure your sending service includes the correct validation headers.
Gotcha 4: Webhook URL Changes on Restart
On self-hosted n8n instances, webhook URLs can change if the workflow ID changes or the instance restarts.
**Fix:** Use a consistent workflow ID. Configure your reverse proxy to forward requests based on a stable path rather than relying on the dynamic URL.
Real Example: Receive a Stripe Webhook with n8n
One of the most common webhook use cases is receiving payment notifications from Stripe. Here is how to set it up.
What You Need
- An n8n instance (cloud or self-hosted)
- A Stripe account with webhook endpoint configured
- Basic understanding of how Stripe sends event payloads
The Workflow
1. Add a Webhook node in Production mode (POST method)
2. Add a Code node or IF node to check the Stripe event type
3. Process specific event types (e.g., `payment_intent.succeeded`)
4. Add a Respond to Webhook node to return a 200 OK to Stripe
Stripe sends a JSON payload like this:
```json
{
"id": "evt_1234567890",
"type": "payment_intent.succeeded",
"data": {
"object": {
"id": "pi_abc123",
"amount": 2000,
"currency": "usd"
}
}
}
```
Your n8n workflow receives this payload, checks the `type` field, and processes accordingly. For each Stripe event type you want to handle, add a conditional branch.
How Do I Secure My n8n Webhook?
**The best way to secure an n8n Webhook is to validate the incoming request using a shared secret token, verify the source IP address, and use HTTPS for all webhook traffic. Never expose webhook URLs publicly unless they include authentication.**
Method 1: Shared Secret Token
Add a header check in your workflow. Require an `Authorization` header with a pre-shared token. In n8n, use an IF node to check the header value and halt if it does not match:
```
{{ $headers.authorization }} === "Bearer YOUR_SECRET_TOKEN"
```
If the token does not match, use a Respond to Webhook node to return a 401 Unauthorized.
Method 2: Source IP Allowlisting
Restrict webhook access to known IP addresses. For Stripe webhooks, Stripe publishes its IP ranges. Use an IF node to check `$execution.resumeUrl` or add IP filtering at the proxy level.
Method 3: Signature Verification
For services like Stripe and GitHub, verify the cryptographic signature in the webhook payload. Stripe includes a `Stripe-Signature` header with an HMAC signature. Verify this using a Code node before processing.
Can I Use n8n Webhooks with Custom Applications?
**Yes, you can call n8n webhooks from any application that can send an HTTP request. Use POST with a JSON body for sending structured data, GET for triggering with query parameters, and always handle the response correctly in your application code.**
Example cURL request:
```bash
curl -X POST https://your-n8n-instance/webhook/my-workflow \
-H "Content-Type: application/json" \
-d '{"event": "user_signup", "user_id": "123", "email": "user@example.com"}'
```
Example JavaScript fetch call:
```javascript
const response = await fetch('https://your-n8n-instance/webhook/my-workflow', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ event: 'user_signup', user_id: '123' })
});
const data = await response.json();
```
FAQ
**Q: What is the difference between the Webhook Trigger node and the regular Webhook node in n8n?**
The Webhook Trigger node starts a workflow when an HTTP request arrives. The regular Webhook node is used mid-workflow to make an outbound HTTP request to another service. For receiving webhooks, always use the Trigger version.
**Q: Can I use the same webhook URL for multiple workflows?**
No, each n8n workflow has its own unique webhook URL. However, you can route different event types from the same source by checking the payload inside a single workflow and branching accordingly.
**Q: How do I test a webhook locally with n8n?**
Use a tool like ngrok to expose your local n8n instance to the internet. Run your n8n in Development mode, start ngrok, and use the ngrok URL as your webhook endpoint while testing.
**Q: Why is my n8n webhook returning a 403 error?**
A 403 Forbidden error usually means the request was blocked by n8n's payload validation (on n8n.cloud), an invalid signature, or the workflow was not in Production trigger mode. Check your workflow mode and validation settings.
**Q: Can Synta generate a webhook workflow for me automatically?**
Yes. Describe the webhook you want to build in plain English to Synta, and it generates a production-ready n8n workflow with the correct configuration, error handling, and response handling. Try it at synta.io.