What is a webhook? (and how to test one)

The simple idea behind most instant automations, explained with a real example.

5 min read

The idea in one sentence

A webhook is a URL that waits for other apps to send it data. Instead of your automation checking "anything new?" every few minutes, the other app calls the URL the moment something happens.

Example: your website form sends the visitor's name and email to your n8n webhook URL, and your flow starts instantly.

Test URL vs production URL in n8n

  • Test URL (contains /webhook-test/): only works while you click Listen for test event. Use it while building.
  • Production URL (contains /webhook/): works whenever the workflow is Active. Use it in your real form or app.

Send a test request yourself

Replace the URL with your own webhook URL and run this in a terminal:

Copy this
curl -X POST https://YOUR-N8N-DOMAIN/webhook-test/new-lead \
  -H "Content-Type: application/json" \
  -d '{"name": "Sara", "email": "sara@example.com", "message": "Hi!"}'

Where is the data?

In n8n, everything that was sent arrives under body. So the name above is {{ $json.body.name }} in the next node.

Keep it safe

  • Treat webhook URLs like passwords — anyone with the URL can trigger your flow.
  • In the Webhook node, turn on Header Auth and send a secret header from your form.
  • Never put secrets in the URL itself.

Flows to try next