Testing n8n Webhooks Locally
with curl Before Production

A repeatable way to send a test HTTP request to an n8n Webhook node, inspect the incoming JSON, distinguish test and production URLs, and troubleshoot the most common failures before connecting a workflow to production systems.

By Ashraf GamalUpdated 12 October 2026n8n · Webhook testingApprox. 5 min read

Personal note: This article reflects my experience and is for educational purposes only—not official vendor guidance. Always verify procedures against current vendor documentation.

1. Objective and scope

The goal is to prove that an n8n Webhook node can receive an HTTP POST request and parse its JSON body before the workflow is connected to any production system. The workflow can be tested with curl from the n8n host or another machine that can reach it over the network.

In the lab setup documented in the conversation, n8n is already running on port 5678 and the chosen test path is n8n-test. The private host address is intentionally left as a variable in this public article. The conversation did not record a completed curl response or a successful n8n execution, so successful delivery is a validation step—not a claimed result.

2. Configure the Webhook node

  1. Create or open the workflow in n8n and add a Webhook trigger node.
  2. Set HTTP Method to POST.
  3. Set Path to n8n-test, matching the path you plan to call. If you use a different path, update the curl URL to match it exactly.
  4. For a restricted local smoke test, choose the authentication setting appropriate for your lab. Do not expose a webhook with authentication disabled to untrusted networks.
  5. Select Listen for test event (or the equivalent test execution action in your n8n version) so the test URL is registered before sending the request.

n8n generates a separate test URL and production URL for each Webhook node. The test URL is used while building and debugging the workflow; the production URL is registered when the workflow is published. See the official Webhook node documentation.

3. Send a test request with curl

Run the following from the same host as n8n by using localhost, or replace the base URL with the address reachable from the machine running curl. For example, in a shell:

# Use localhost when curl runs on the n8n host.
# For a remote test client, use the n8n host's reachable LAN address.
N8N_BASE_URL="http://localhost:5678"

curl -i --max-time 10 -X POST \
  "${N8N_BASE_URL}/webhook-test/n8n-test" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "n8n webhook connectivity test",
    "source": "curl",
    "test": true
  }'

-i prints the HTTP response headers as well as the response body, and --max-time 10 prevents the client from waiting indefinitely. The request body is deliberately small and contains synthetic test values. Replace the URL path if the Webhook node uses a different path.

Timing matters for test URLs

The test URL only works while n8n is listening for the test event. Current n8n documentation states that the test webhook remains registered for 120 seconds after the test listener is started. Start listening immediately before running curl if the test endpoint has expired.

4. Validate the execution

Confirm both sides of the request rather than relying only on an HTTP status:

If you want curl to receive a final workflow result, configure the Webhook node to respond when the last node finishes, or use a Respond to Webhook node. Choose a response mode that matches the workflow's actual behavior.

5. Known issues and troubleshooting

Connection refused or timeout

Webhook not registered or not found

The request arrives, but the workflow output is not what I expected

For further diagnostics, the official Webhook common-issues guide includes curl examples and advice for test versus production URLs.

6. Checklist before production

  1. Confirm the request body and workflow execution are correct using the test URL.
  2. Save and publish the workflow, then switch the caller to the production URL shown by the Webhook node, usually /webhook/n8n-test.
  3. Use appropriate webhook authentication (Basic, Header, or JWT where suitable), restrict network access, and use HTTPS for production traffic.
  4. Review the production workflow's response mode and error paths so the caller receives a truthful HTTP status and response body.
  5. After switching URLs, run a controlled production-path check and review the workflow's Executions view. Production executions do not appear in the editor's test canvas in the same way as test events.
Test and production are separate endpoints

Do not leave a production caller pointed at /webhook-test/. Test URLs are for active development sessions; published workflows use the production URL. Re-check authentication, URL reachability, and execution logs before relying on the endpoint.

7. Official references

This article documents the planned local validation process, not a verified successful test. Record the actual curl status and n8n execution output before describing the webhook as working in your environment. Validate these steps against the documentation for your installed n8n version.

Discuss workflow testing and automation

Need help validating a self-hosted n8n workflow or preparing an API endpoint for production?

Reach out to discuss webhook testing, HTTP API integrations, workflow reliability, and production-readiness.