Hello! Welcome back to our second module on n8n's core concepts.
In our last lesson, you learned how to automate workflows based on time using the Schedule Trigger. This is perfect for recurring tasks like daily reports or hourly checks. However, many automation scenarios aren't time-based; they're event-based. You need a workflow to run right now because something just happened in another application.
This is where our topic for today comes in. This lesson covers the Webhook Trigger, the primary mechanism in n8n for starting workflows from external events. By the end of this lesson, you will be able to configure a Webhook Trigger to receive data from external HTTP requests and kick off your automations in real-time.
As a software developer, you're already familiar with the concept of webhooks as a cornerstone of modern service-to-service communication. In n8n, they function as simple, powerful API endpoints that you can create in seconds to integrate with virtually any service on the web.
1. What is a Webhook?
Before we dive into the configuration, let's establish a clear conceptual model. A webhook is essentially a URL that listens for incoming HTTP requests. Instead of your workflow constantly asking another service "Did anything new happen?" (a process called polling), the external service can directly notify your n8n workflow by sending a message to its unique webhook URL the moment an event occurs.
This event-driven approach is more efficient and provides real-time responsiveness. The video below gives an excellent overview of this concept and its importance in the automation landscape.
Step-by-Step: N8N Webhooks (From Beginner to Pro)
Watch this introductory segment from Nick Saraev's video 'Step-by-Step: N8N Webhooks' to understand what webhooks are and the role they play in connecting different applications.
Watch the introductory section for the first three and a half minutes of the video. The explanation uses a simple analogy to clarify the concept of webhooks as messages between applications.
2. Configuring the Webhook Trigger Node
Let's get hands-on. Create a new workflow and replace the default trigger with a Webhook node. When you open its parameters, you'll see several key configuration options.

Here are the most important settings to understand:
-
Webhook URLs: n8n provides two distinct URLs.
- Test URL: Use this while you are building and testing your workflow. It allows you to use the "Listen for test event" button to capture incoming data and build out the subsequent steps.
- Production URL: Once your workflow is complete and activated, you use this stable URL. Requests to this URL will trigger live executions.
-
HTTP Method: This determines which HTTP verb the webhook will respond to. While you can use any standard method (
GET,PUT,DELETE, etc.), you will most commonly use:GET: For simple triggers, often passing data via URL query parameters.POST: The most frequent choice, used when an external service needs to send a data payload (e.g., a JSON object) in the request body.
-
Path: This is the unique slug for your webhook's URL. n8n generates a random one, but you can customize it to be more descriptive, for example,
/new-user-signupor/process-order. This is useful for creating clean, understandable endpoints. -
Authentication: This allows you to secure your webhook. We'll revisit this important topic later in the lesson.
For a detailed walkthrough of these settings, let's return to the video guide.
Step-by-Step: N8N Webhooks (From Beginner to Pro)
This segment demonstrates how to configure the basic parameters of the Webhook node.
Starting around three and a half minutes in, watch the webhook setup. Pay close attention to the distinction between Test and Production URLs and the explanation of different HTTP methods.
For a comprehensive written reference of all available parameters, you can consult the official n8n documentation.
The official documentation provides a complete reference for all the Webhook node's parameters and options.
Skim through the sections 'Webhook URLs', 'HTTP Method', and 'Path' to reinforce your understanding of the core parameters. You don't need to read the entire page right now.
3. Testing the Webhook and Receiving Data
Now for the fun part: triggering the webhook and seeing the data flow into n8n. The process is always the same:
- In the Webhook node, click Listen for test event. The node will now wait for one incoming request.
- Send an HTTP request to the Test URL.
- Once n8n receives the request, the node will display the data it captured.
Let's try a few different ways to send that request.
Method 1: The Browser (GET request)
The simplest test is to copy the Test URL and paste it into a new browser tab. Hitting Enter sends a GET request.
After you do this, switch back to n8n. You'll see that the workflow has received data. In the output panel, you can inspect the headers from your browser, along with empty params, query, and body objects.
Method 2: Adding Query Parameters
To send data with a GET request, you can add query parameters to the URL. This is a standard key-value format.
- Click Listen for test event again.
- Copy the Test URL and append it with parameters like this:
?name=Alex&role=developer. - Paste the full URL into your browser and press Enter.
Now, inspect the output in n8n. You will see that the query object contains the data you sent:
{
"name": "Alex",
"role": "developer"
}
The following short clip demonstrates this process clearly.
Using webhooks in n8n (parameters, responses and triggers)
This quick video from Oskar shows how to pass parameters in the webhook URL and access them within n8n.
Starting about 30 seconds in, watch the URL parameters. Notice how the URL is constructed and how the parameters appear in the webhook's output data.
Method 3: Using an API Client (POST request)
For sending complex data, POST requests are standard. You can't easily make a POST request from a browser's address bar, so you'll need a tool. As a developer, you're likely familiar with curl or GUI tools like Postman or Insomnia.
- Change your Webhook node's HTTP Method to
POST. - Click Listen for test event.
- Open your terminal and use
curlto send a request with a JSON body. Replace<YOUR_TEST_URL>with your actual test URL.
curl -X POST \
<YOUR_TEST_URL> \
-H "Content-Type: application/json" \
-d '{
"leadId": "xyz-123",
"email": "test@example.com",
"source": "website-form"
}'
Back in n8n, you'll now find your JSON payload inside the body object of the output.

Test your understanding!
Imagine you need to create a webhook that accepts product information. Configure your Webhook node to accept POST requests. Then, write a curl command to send a JSON object with the following properties to your test URL: productId (a string), productName (a string), and quantity (a number).
Show answer
First, set the HTTP Method in your Webhook node to POST and click "Listen for test event".
Then, run the following curl command in your terminal, replacing <YOUR_TEST_URL> with the one from your n8n canvas:
curl -X POST \
<YOUR_TEST_URL> \
-H "Content-Type: application/json" \
-d '{
"productId": "SKU-98765",
"productName": "Wireless Mouse",
"quantity": 50
}'
You should see this data appear in the body section of your webhook's output in n8n.
4. Responding to the Webhook
By default, when a webhook is triggered, n8n immediately sends back a generic { "message": "Workflow was started" } response. This lets the calling service know the request was received, and n8n then continues executing the workflow in the background.
However, for many API-like use cases, you need to return custom data after your workflow has finished processing. To do this, you must change the Respond option in the Webhook node from Immediately to Using 'Respond to Webhook' Node.
This allows you to add a Respond to Webhook node anywhere in your workflow. The workflow will pause at this node, send back the data you've configured, and then the execution will end. This is extremely powerful for building custom endpoints.
The following video provides an excellent demonstration of this pattern. It builds a workflow that receives a parameter, uses an IF node to make a decision, and then uses the Respond to Webhook node to redirect the user's browser to a different URL.
Using webhooks in n8n (parameters, responses and triggers)
Watch this segment to learn how to create dynamic responses using the 'Respond to Webhook' node in combination with conditional logic.
About a minute in, watch the redirect setup. Focus on how the Webhook node's 'Respond' setting is changed, and how the 'Respond to Webhook' node is configured to send a 308 redirect header.
5. Securing Your Webhook
If your webhook URL is public, anyone who knows the URL can trigger your workflow. For many internal or low-stakes automations, this might be acceptable. But for anything handling sensitive data or performing critical actions, you must add authentication.
The Webhook node offers several authentication methods under the Authentication dropdown. The two most common are:
- Basic Auth: Requires the client to provide a username and password in the request headers.
- Header Auth: Requires the client to send a secret token (like an API key) in a custom request header.
Let's see how to configure these.
Step-by-Step: N8N Webhooks (From Beginner to Pro)
This final video clip explains and demonstrates how to secure your webhook endpoints using both Basic and Header authentication.
Around the 28-minute mark, watch the authentication segment. Observe how adding authentication prevents unauthorized requests and how to properly add the credentials to a request from another n8n workflow.
Conclusion
You now have one of the most powerful tools in the n8n toolkit at your disposal. You've moved from time-based triggers to event-based triggers, opening up a world of real-time integrations.
Key Takeaways:
- The Webhook Trigger starts a workflow when it receives an HTTP request at its unique URL.
- Always use the Test URL for development and the Production URL for live, active workflows.
- Data can be passed via query parameters (in the URL, for
GETrequests) or in the request body (as a payload, forPOSTrequests). - The incoming data is available in the webhook's output under the
query,params, andbodyobjects. - To return a custom response, change the Respond mode and use the Respond to Webhook node.
- Secure your public-facing webhooks using Basic Auth or Header Auth.
In our next lesson, we will take a closer look at the Manual Trigger. While you've used it implicitly to test workflows, we'll explore its specific configurations and how to use it effectively during development and for workflows that require human intervention.