Webhooks let other apps start your workflow instantly and even turn a workflow into a small API.
A webhook is an automatic message one system sends to a web address when something happens: "invoice paid", "form submitted". The Webhook trigger node gives your workflow such an address.
Each Webhook node has two URLs:
- The test URL works only while you click "Listen for test event" in the editor. The incoming data appears in the node so you can build the next steps.
- The production URL works once the workflow is published. Its runs show up in the Executions list, not on the canvas.
Give the production URL to the sending system. Mixing the two up is the most common webhook problem.
Settings:
- HTTP method: usually POST (data in the body) or GET.
- Authentication: Basic Auth, Header Auth or JWT (a signed access token), so strangers can't trigger your workflow, plus an optional IP allowlist (only accept calls from listed computer addresses).
- Respond: "Immediately" (reply right away, then keep working), "When Last Node Finishes" (reply with the final result), or "Using 'Respond to Webhook' Node" (you decide exactly what to send back and when). Streaming replies are also possible for AI agents.
With "When Last Node Finishes" or Respond to Webhook, your workflow becomes a small API: another app sends a question and gets n8n's computed answer.
The incoming body, headers and query appear in the item, so the payload below would be reached with {{ $json.body.customer.email }}. Maximum payload size defaults to 16 MB.
Example
{
"event": "invoice.paid",
"invoice_id": "INV-1042",
"amount": 249.0,
"customer": { "name": "Ana Lopez", "email": "ana@example.com" }
}Remember
- Test URL for building, production URL after publishing
- Protect webhooks with authentication
- Choose how to respond: immediately, at the end, or via Respond to Webhook
Watch out for
- Configuring the sending app with the test URL, which stops working as soon as you stop listening.