How to Test an n8n Webhook From the Command Line With curl

Tested by TNT Review — record TNT-TEST-2026-10-05-019, 5 October 2026. We ran the exact curl commands below against a real local server and captured the real responses. See Verification.

The problem

An n8n workflow triggered by a Webhook node needs something to actually send it a request before you can see it work — clicking “Listen for Test Event” and then hunting for a way to send that request is a common first stumbling block, especially for anyone who hasn’t used curl before.

Expected outcome

By the end of this guide you will know the exact curl command shape to trigger any webhook, practiced safely against a tiny local stand-in server before you point it at a real n8n instance.

Requirements and costs

  • Node.js (for the practice receiver) and curl (included by default on macOS/Linux; available on Windows 10+ too).
  • Cost: free.

Step-by-step implementation

  1. Download the practice receiver from the link below and run it: node practice-receiver.js.
  2. In a second terminal, send it a test request:
    curl -X POST http://localhost:3999/webhook-test \
      -H "Content-Type: application/json" \
      -d '{"hello":"world"}'
  3. Read the response and the receiver’s own console log — both show exactly what arrived.
  4. Once comfortable, open your real n8n workflow’s Webhook node, click “Listen for Test Event” to get its real Test URL, and swap that URL into the same curl command.

A real example

$ curl -X POST http://localhost:3999/webhook-test -H "Content-Type: application/json" -d '{"event":"new_order","total":42}'
{"received":true,"method":"POST","path":"/webhook-test","body":{"event":"new_order","total":42}}

$ curl http://localhost:3999/webhook-test
{"received":true,"method":"GET","path":"/webhook-test","body":null}

The second example shows what happens with no -X POST flag at all — curl defaults to GET, which many webhooks (including n8n’s, depending on configuration) won’t accept the same way a POST would.

Verification and troubleshooting

What we tested, on 5 October 2026 (record TNT-TEST-2026-10-05-019): ran the exact POST command above against the real local practice receiver and got back the exact JSON body shown, confirming the server correctly parsed and echoed it. Ran a plain GET against the same URL and confirmed it correctly reported method “GET” with a null body — both real command outputs, not constructed examples.

Troubleshooting:

  • “Connection refused.” The receiver (or your real n8n instance) isn’t running, or you’re pointing at the wrong port — check the terminal where you started it for the actual listening address.
  • n8n shows “waiting for webhook call” forever. Double check you’re using the TEST URL (shown after clicking “Listen for Test Event”), not the production URL, which only works once the workflow is activated.
  • Your real webhook expects a different content type. Change -H "Content-Type: application/json" to match, and make sure -d‘s value matches that format (e.g. form-encoded instead of JSON).

What to do next

Once a real webhook call reaches your workflow correctly, test what happens with a malformed or incomplete body too — a webhook that only ever receives perfectly-formed requests in testing can still fail quietly once something less well-behaved sends it real traffic.

Free resources

The download contains the practice receiver.

Download the practice receiver (ZIP, 1 KB)

Is there a paid version?

Not applicable. curl and n8n’s Webhook node are both free.

Leave a comment