Introduction
In our last lesson, you mastered the use of n8n expressions to parse and transform API responses, giving you fine-grained control over the data flowing through your workflows. We've focused on workflows that you initiate, either manually or on a schedule, to pull data from external systems. Now, we'll pivot to a more reactive approach, enabling external systems to push data to n8n and trigger your workflows on demand.
This lesson introduces the Webhook node, a fundamental trigger for building event-driven automations. For your goal of automating CI/CD pipelines, this is the primary mechanism you will use. A webhook acts as a dedicated URL that can listen for events from services like GitHub, GitLab, or Jenkins. When a developer pushes new code, a build completes, or a pull request is opened, these services can send a notification to your n8n webhook, instantly kicking off your automation logic.
By the end of this lesson, you will be able to set up a Webhook node to trigger a workflow from an external HTTP request, laying the groundwork for all your future CI/CD integrations.
From Polling to Pushing: The Power of Webhooks
So far, you've used triggers that run on a schedule. This is a form of polling, where n8n periodically asks an API, "Is there anything new?" This can be inefficient if events are infrequent.
Webhooks reverse this model. A webhook is a unique, persistent URL that waits for an external service to send it data. This is an event-driven approach. Instead of n8n asking for updates, your Git repository or CI server tells n8n exactly when an event has occurred. This is far more efficient and enables real-time automation.
The following resource provides a clear definition of webhooks and highlights their importance in event-driven automation.
n8n Webhook Tutorial: Trigger Workflows from Anywhere (2026)
This article from Lumberjack provides an excellent introduction to the concept of webhooks in n8n.
Please read the first section, "What is an n8n Webhook?", to solidify your understanding of their event-driven nature. Then, glance at the GitHub integration example to see a direct application for your CI/CD goals.
In n8n, there are two primary nodes for this:
- Webhook: A trigger node (marked with a lightning bolt) that starts a workflow when it receives an HTTP request.
- Respond to Webhook: A regular node used to send a custom response back to the system that called the webhook.
This lesson focuses entirely on the first one: setting up the listener. We will cover how to send custom responses in our next session.
Configuring Your First Webhook
Let's begin by setting up a Webhook node. When you add one to your canvas, you'll see its configuration panel.

Here are the most important parameters to understand:
- Webhook URLs: n8n provides two distinct URLs. This is a critical concept. The Test URL is for use only within the n8n editor when you click "Listen for Test Event." It's temporary and allows you to capture sample data to build your workflow. The Production URL is a permanent endpoint that works only when your workflow is saved and activated. It's the URL you will give to services like GitHub for live integrations.
- HTTP Method: This defines which HTTP request method the webhook will accept. For receiving data payloads, such as a webhook from a Git provider, you will almost always use
POST.GETis useful for simple triggers that might only pass data in the URL itself. Your experience with APIs will make these concepts familiar. - Path: n8n auto-generates a unique path, but you can customize it to be more descriptive (e.g.,
github-push-trigger). This is highly recommended for keeping your endpoints organized. - Authentication: You can secure your webhook so that only authorized services can trigger it. While essential for production, we will set this to
Nonefor now to focus on the mechanics. We'll revisit security in a later module.
The following video provides an excellent walkthrough of these core settings, especially the distinction between test and production URLs.
Beginner’s Guide to n8n Webhooks (No Coding Required)
This segment from "Beginner’s Guide to n8n Webhooks" by Ryan & Matt Data Science clearly explains the URL settings.
Watch the section from exploring URLs. Pay close attention to the explanation of the test vs. production URLs and the demonstration of how customizing the path changes the URL.
Hands-On: Capturing a Simulated Git Push Event
Now, let's create a workflow that listens for a git push event. We'll simulate this event by sending an HTTP request from your terminal using curl, a tool you're likely familiar with.
1. Create and Configure the Webhook Node
- Start a new workflow. The Start node is not needed; the Webhook node will be the trigger.
- Click the + button to add a node and search for
Webhook. - In the Webhook node's settings:
- HTTP Method: Set to
POST. This is standard for webhooks that carry a data payload. - Path: Customize the path to something memorable, like
cicd-push-receiver. - Authentication: Leave as
None.
- HTTP Method: Set to
2. Listen for a Test Event
- Click the Listen for Test Event button in the top right of the Webhook node panel. A spinner will appear, indicating that n8n is now actively listening for a request on the Test URL.
3. Trigger the Webhook with curl
- Now, open a terminal. We're going to send a
POSTrequest containing a simplified JSON payload that mimics what GitHub might send. - Copy the Test URL from the Webhook node.
- In your terminal, execute the following
curlcommand, replacing<YOUR_TEST_URL>with the URL you just copied:
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"ref": "refs/heads/main",
"repository": {
"name": "my-awesome-project",
"full_name": "your-username/my-awesome-project"
},
"pusher": {
"name": "your-username",
"email": "your-email@example.com"
},
"head_commit": {
"id": "0d1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f90",
"message": "feat: Add initial CI/CD webhook trigger",
"timestamp": "2024-05-21T10:00:00Z"
}
}' \
'<YOUR_TEST_URL>'
4. Inspect the Incoming Data
- If successful,
curlwill receive a response like{"message":"Workflow received. You can now close this window."}. - Switch back to n8n. The Webhook node will show that it has received the event, and the output panel will display the data. You'll see that n8n has automatically parsed the JSON payload and organized it under the
bodyobject. You'll also see request headers and any query parameters (though we didn't use any here).
This is the raw data your workflow will operate on. In the previous lesson, you learned how to use expressions like {{$json.body.head_commit.message}} to extract the commit message. Now you see where that data comes from.
The following video provides a visual demonstration of this entire process, from setting up the listener to sending data and inspecting the output.
N8N Webhooks Masterclass: Beginner to Pro in 13 Minutes
This clip from "N8N Webhooks Masterclass" by Intellagents demonstrates the core workflow of testing a webhook. Although it uses Postman, the principle is identical to our curl exercise.
Watch the segment from setting one up. This shows how to listen for an event, send data from an external tool, and then see that data appear within n8n, ready to be used in subsequent nodes.
From Test to Production
You've successfully tested your webhook. To make it live, you must save and activate the workflow. Once active, the Production URL becomes live, and the Test URL will no longer work for triggering the entire workflow.
Forgetting this distinction is a very common source of errors. It's crucial to always provide the Production URL to the external service (like GitHub) that will be triggering your workflow.
n8n Webhook Tutorial: Trigger Workflows from Anywhere (2026)
To reinforce the process of going live and avoiding common issues, please review these sections from the Lumberjack tutorial.
First, read Step 6 to understand the process of saving, activating, and testing with the Production URL. Then, carefully read the section on Common Mistakes. Internalizing these points now will save you significant debugging time later.
Conclusion
You have now established one of the most important connections in your automation toolkit: the ability for external systems to trigger your n8n workflows. You learned that webhooks provide an efficient, event-driven way to start automations, which is perfectly suited for CI/CD pipelines.
Key Takeaways:
- Webhooks are triggers that listen for incoming HTTP requests, allowing external systems to initiate your workflows.
- The Test URL is for development in the editor, while the Production URL is for live, active workflows.
- The
POSTmethod is typically used for webhooks that carry a JSON data payload. - You can test webhook triggers using command-line tools like
curlto simulate events from services like GitHub. - Activating a workflow is required to make the Production URL live.
In the next lesson, we will complete the other half of the conversation. You will learn how to use the Respond to Webhook node to send custom data and status codes back to the caller, effectively turning your n8n workflows into simple, dynamic APIs.