n n8n

How to build a webhook trigger on n8n

beginner 12 min read Updated 2026-03-13
Quick Answer

n8n webhooks turn workflows into real-time HTTP endpoints for event-driven automation. Set up by adding a Webhook trigger node, configuring HTTP method and path, testing with Listen for Test Event, then activating the workflow to enable the Production URL for live requests.

Prerequisites

  • Running n8n instance (self-hosted or cloud with public URL)
  • Basic knowledge of HTTP methods (POST/GET) and JSON
  • Testing tools: curl, Postman, or browser
  • Workflow editor access

Step-by-Step Instructions

1

Access n8n Dashboard and Create a New Workflow

Log into your n8n instance and navigate to the Workflows section in the left sidebar. Click the + New button to create a blank workflow canvas where you'll build your webhook trigger.

2

Add the Webhook Trigger Node

On the empty canvas, click the + button to open the node selector. Search for Webhook and select the Webhook node (marked with an orange lightning bolt as a trigger node under Core Nodes). Drag it to the canvas. This node receives HTTP requests to start your workflow.

The Webhook node is a trigger node, meaning it can start your entire workflow when it receives data.
3

Configure Webhook Node Settings

Double-click the Webhook node to open its settings panel and configure these key options:

  • HTTP Method: Select POST (default for data payloads; change to GET/PUT/PATCH/DELETE as needed)
  • Path: Enter a unique path like webhook-trigger (creates URL like https://your-n8n-instance/webhook/webhook-trigger)
  • Response Mode: Choose Immediately (responds instantly) or Using Respond to Webhook node (for custom responses later)
  • Authentication: Leave as None for basic setup; enable Header Auth or Basic Auth if securing the endpoint
  • Ignore Bots: Toggle On to ignore crawlers like link previewers
  • IP Whitelist: Leave blank to allow all IPs, or add comma-separated IPs like 192.168.1.1,10.0.0.1 for restriction
POST is the most common HTTP method for webhook payloads containing data.
4

Copy the Webhook URLs

In the Webhook node panel, you'll see two URLs:

  • Test URL: For development; starts with https://your-n8n-instance/webhook-test/... and changes each time you open the workflow
  • Production URL: For live use; only active when the workflow is activated and remains stable

Copy both URLs for the next steps. The Production URL is essential for real-world integrations.

The Test URL is temporary and regenerates when you reopen the workflow, so always use the Production URL for permanent integrations.
5

Test the Webhook with Listen for Test Event

Click Listen for Test Event in the node panel (the button turns green). Use a testing tool like curl or Postman to send a request:

curl -X POST "TEST_URL?brand=workflows&action=subscribe" -H "Content-Type: application/json" -d '{"data": "test payload"}'

Data appears in the node's output panel, showing query parameters and body data. Click the pin icon to save this test data for reference in building subsequent nodes.

Always use Listen for Test Event during development to see incoming data in real-time.
6

Add Data Processing Nodes (Optional)

After the Webhook node, add processing nodes to handle the incoming data. Common options include:

  • Code Node: Write JavaScript to validate or transform JSON data
  • IF Node: Create conditional logic based on webhook payload
  • HTTP Request Node: Forward data to external APIs or services

Connect these nodes to the Webhook output to build your automation logic.

Use a Code Node to validate incoming JSON and ensure required fields exist before processing.
7

Save the Workflow

Click Save in the top toolbar. A dialog appears prompting you to name the workflow (e.g., "Webhook Trigger Workflow"). Enter a descriptive name and confirm. Saving preserves your configuration and node setup.

Use clear naming conventions like 'webhook-[action]' to easily identify webhook workflows in your list.
8

Activate the Workflow for Production

Toggle the Active switch in the top-right corner of the canvas (turns green when enabled). Activating the workflow enables the stable Production URL and makes your webhook live for real requests. Deactivate the workflow when you need to edit it.

Only activated workflows generate a stable Production URL; test workflows use the temporary Test URL.
9

Handle Custom Responses (Optional)

If you set Response Mode to Using Respond to Webhook node, add a Respond to Webhook node after your processing logic. Search for it in the node selector and connect it to the end of your workflow. Configure:

  • Respond With: No Data (default) or JSON (custom response body)
  • Response Code: 200 for success, or other HTTP status codes as needed

This node controls what the webhook returns to the caller after processing completes.

Use custom responses to confirm successful data receipt or return processed results to the sender.
10

Test with Production URL and Monitor Executions

Once activated, send requests to the Production URL using curl, Postman, or your integration source. Monitor workflow executions by clicking the Executions tab in the workflow editor. Each execution shows the incoming data, node outputs, and any errors. Use this to verify your webhook is receiving and processing data correctly.

Check the Executions tab to debug issues and confirm that your webhook is triggering as expected.

Common Issues & Troubleshooting

No data received or webhook not triggered

Test URL changes every time you open the workflow and only works with Listen for Test Event active. Solution: Always click Listen for Test Event for testing, copy a fresh Test URL, then save and activate the workflow (toggle turns green) and use the stable Production URL for real use. Test via curl -X POST [Production URL] -d '{"key":"value"}'.

404 Not Found or invalid path errors

Random default paths may mismatch the sender's URL or fail to handle route parameters. Solution: Set an explicit Path like /contact-form in the Webhook node settings instead of using auto-generated paths. Ensure the sender uses the exact URL path you configured.

Workflow executes but returns no response

Response Mode set to Immediately returns only 'Workflow got started' message. Solution: If you need custom response data, change Response Mode to Using Respond to Webhook node and add a Respond to Webhook node at the end of your workflow to return processed data.

Authentication errors or unauthorized access

Webhook is unsecured or sender lacks proper credentials. Solution: Enable Authentication in Webhook node settings (Header Auth or Basic Auth), share credentials securely with the sender, and ensure they include Authorization headers in their requests.

Workflow inactive after saving

Workflow must be explicitly activated to enable Production URL. Solution: Toggle the Active switch in the top-right corner of the canvas (turns green). Deactivate only when editing; reactivate when ready for live requests.