Start with n8n webhook trigger: how to use?
Use the n8n Webhook node to receive HTTP requests and trigger workflows. The Webhook node gives you a URL to call. This lets you run automation from external services in seconds. In this guide you will see Docker and Node.js commands, curl tests, and update plus security advice.
What You Need
- Docker installed or Node.js and npm.
- An n8n instance (local or cloud).
- Basic command line knowledge and curl for testing.
- Optional: ngrok for local HTTPS tunneling.
How to use n8n webhook trigger: how to use in Docker
Follow these numbered steps to run n8n with Docker and add a Webhook node.
- Start n8n with Docker. This command runs n8n on port 5678.
docker run -it --rm \
-p 5678:5678 \
-e N8N_BASIC_AUTH_ACTIVE=true \
-e N8N_BASIC_AUTH_USER=myuser \
-e N8N_BASIC_AUTH_PASSWORD=mypassword \
n8nio/n8n:latest
- Open the n8n editor at http://localhost:5678. Create a new workflow.
- Add a Webhook node. Set HTTP Method to POST or GET and set a path like
receive-data. Save the node. - Copy the webhook URL shown in the node. It looks like
http://HOST:PORT/webhook/receive-data. - Test the webhook with curl.
curl -X POST http://localhost:5678/webhook/receive-data \
-H "Content-Type: application/json" \
-d '{"name":"Alice"}'
When the webhook receives the request, the workflow runs. Add a Set or HTTP Request node to process or forward the data.
How to use n8n webhook trigger with Node.js (local)
You can run n8n directly with Node.js. Install and start n8n with these commands.
npm install -g n8n
n8n start
Open the editor at http://localhost:5678 and follow the same Webhook node steps above. Use ngrok if you need a public HTTPS URL while developing.
Step-by-step workflow logic
1. Create Webhook node with a unique path.
2. Add nodes to parse and validate incoming JSON.
3. Save the workflow and set it active.
4. Send a test request with curl or via the external service.
5. Monitor execution in the n8n editor logs.
Update
Keep n8n updated to get fixes and features. For Docker, pull the latest image then restart the container.
docker pull n8nio/n8n:latest
# then restart your container with the same flags
Security
Use basic auth or other auth to protect the editor and webhooks. Enable HTTPS in production. Validate incoming data and use secret headers.
docker run -it --rm \
-p 5678:5678 \
-e N8N_BASIC_AUTH_ACTIVE=true \
-e N8N_BASIC_AUTH_USER=admin \
-e N8N_BASIC_AUTH_PASSWORD=strongpassword \
-e WEBHOOK_TUNNEL_URL=https://your-domain.com \
n8nio/n8n:latest
Do not expose the n8n editor without authentication. Limit webhook exposure with IP allow lists or API keys where possible.
Done
You now know how to use the n8n webhook trigger to start automations. Run n8n in Docker or Node.js, add a Webhook node, and test with curl. Update the image regularly and follow the security tips for production.