SuperAPI AI Directory

n8n: webhook trigger and test/production URLs

The Webhook node in n8n is a core trigger node used to create a webhook to receive event data from applications and services, thereby starting an n8n workflow. It provides both test and production webhook URLs, supports standard HTTP methods, multiple authentication methods (Basic, Header, JWT, n8n user OAuth2), custom response modes (respond immediately, when last node finishes, using the Respond to Webhook node, streaming response), as well as advanced options such as CORS, IP allowlist, and raw request body. This node also supports returning workflow results as an API endpoint, making it suitable for building automated processes that process data and return results.

Open website

About this tool

The Webhook node is a core trigger node in n8n, used to create a webhook that receives data from applications and services when events occur and starts an n8n workflow. It allows services that do not have a dedicated app trigger node to connect to n8n and run workflows. This node also supports returning data generated at the end of the workflow, making it suitable for building API endpoint-style workflows that process data and return results.

Main capabilities:

  • Provides both test and production webhook URLs. The test URL is registered via "Listen for Test Event" or "Execute workflow" when the workflow is not active, and after being called, the data can be displayed in the workflow; the production URL is registered after the workflow is published, and data is not displayed directly when called, but execution data can be viewed in the Executions tab.
  • Supports standard HTTP request methods (such as GET, POST, PUT, PATCH, etc.).
  • The default maximum payload is 16MB; when self-hosted, it can be adjusted via the environment variable N8N_PAYLOAD_SIZE_MAX.
  • The Path field includes a randomly generated path by default to avoid conflicts; you can also manually specify a path and add route parameters, supporting formats such as /path/:variable, /:variable/path, /:variable1/path/:variable2, /:variable1/:variable2, etc.
  • Supports multiple authentication methods: Basic auth, Header auth, JWT auth, and n8n User Auth (OAuth2). When using n8n User Auth (OAuth2), only users logged in to this n8n instance can call the webhook, and the caller must send an OAuth2 bearer token issued by this instance; GET browser requests without a token are redirected to the login page, and other requests return 401. You can also enable the "Require Workflow Execute Permission" toggle (enabled by default), which requires the calling user to have permission to execute the workflow, otherwise 403 is returned.
  • Response modes include: Immediately (return the response code and the "Workflow got started" message immediately), When Last Node Finishes (return the response code and the last executionnode's data), Using 'Respond to Webhook' Node (define the response according to the Respond to Webhook node), Streaming response (return data in real-time streaming; the workflow must include nodes that support streaming, such as the AI agent node).
  • You can customize the HTTP response code after successful execution and choose the response body content: All Entries (return all items from the last node as an array), First Entry JSON (return the JSON data of the first item as a JSON object), First Entry Binary (return the binary data of the first item as a binary file), No Response Body (do not return a response body).
  • Additional options include: Allowed Origins (CORS) to set the allowed cross-origin domains (comma-separated, default * allows all), Binary Property to receive binary data and specify the property name, Ignore Bots to ignore bot requests, IP(s) Allowlist to restrict the IP addresses allowed to call (comma-separated; returns 403 if not in the list; leave empty to allow all), No Response Body to prevent sending a response body, OAuth2 Client to control handling when there is no bearer token (Auto-Detect, Bearer Token Only, Browser (Virtual Client)), Only Run If expression (decide whether to run based on request content; if it does not match, return 200 but do not create an execution; if the expression fails, log a warning and allow it through), Raw Body to receive raw-format data (such as JSON or XML), Response Content-Type to select the response body format, Response Data to send custom data, Response Headers to send additional response headers, Property Name to specify the JSON key returned.
  • Starting from n8n 1.103.0, n8n automatically wraps webhook HTML responses in an <iframe> tag as a security mechanism. This causes HTML to render in a sandboxed iframe, and JavaScript that attempts to access the top-level window or local storage will fail,authentication headers are unavailable in the sandboxed iframe (use alternatives such as short-lived access tokens instead), and relative URLs (such as <form action="/">) do not work; absolute URLs must be used.

Usage: Add a Webhook node as a trigger in an n8n workflow, configure parameters such as Path, HTTP method, authentication, and response mode, and copy the test or production URL for external services to call. During testing, use the test URL and listen for events; after publishing the workflow, use the production URL.

Use cases: receive event data from applications or services that have no dedicated trigger node and start a workflow; build API endpoints that process data and return results; use a fixed endpoint URL when prototyping APIs; webhook integrations that require authentication, IP restrictions, CORS control, or custom responses.

Limitations: The maximum payload is 16MB by default (adjustable when self-hosted); HTML responses have been automatically wrapped in a sandboxed iframe since 1.103.0, bringing the security limitations described above; under OAuth2 authentication, only GET requests can be redirected; tokens are bound to the webhook trigger that issued them, and using them with other triggers or the instance MCP server returns 401.