Receive JSON from a webhook in n8n

Configure a POST Webhook node, test the incoming JSON, return a response and switch to the production URL.

Tooln8n
Format
5.07 minEnglish
Updated 5.07 min

What you will create

Receive a small JSON request and send an explicit acknowledgement. This starter workflow does not create contacts or orders. It lets you check data transport before attaching an action that changes another tool.

Before you start

Prepare an n8n test workflow and a client that can send HTTP requests. A request has a destination, a method, headers and optionally a body. Here, the body contains fictional values only. Do not include secrets in the sample JSON or share screenshots exposing credentials.

Step-by-step

  1. Add Webhook, choose POST and authentication compatible with the sender. Copy the displayed test URL and start listening for a test event.
  2. Send the JSON below from your HTTP client with Content-Type: application/json. Inspect the received body in the trigger output.
  3. Set Respond to Using 'Respond to Webhook' node. Connect Respond to Webhook, choose JSON and configure the sample response below with status code 200.
  4. Repeat the test, checking both the received body and the response, not just the HTTP status.
  5. After validation, publish the workflow and use its production URL. Review calls in Executions.

Example to adapt

Request body for this exercise:

{"request_id":"TEST-101","topic":"demo","quantity":2}

Test response to configure:

{"received":true,"mode":"test"}

The value 2 should remain a number. “received” only means that this setup received and answered the request. It does not establish that a payment, email or write operation happened. For a real integration, agree required fields and error responses with the team responsible for the sending application.

Check your result

  • Send TEST-101, then TEST-102 with quantity set to 3. Check for two distinct requests and the right value in each.
  • Try calling without valid authentication: it should not start your protected processing.
  • Remove topic from a copy of the sample. This test illustrates why receiving JSON does not guarantee valid business data. Add field checks before any real action.
  • Check the expected response body. A 200 status alone does not validate your full path.

Common problems

No event: compare the method and URL, then check that test listening has started. Unexpected response: confirm that the path reaches the intended response node. Repeated calls: an application may resend a request; a reference does not prevent duplicates by itself. Plan this check before automatically creating records in another service.

Next steps

Explore the n8n overview and learn to receive a workflow failure alert.