EndpointCustom

Create a custom HTTP endpoint to receive POST requests

Overview

This node creates a custom HTTP POST endpoint that can receive requests and respond with a JSON object containing a unique ID, the submitted URL, and a timestamp. It is useful for scenarios where you want to expose a simple API endpoint to collect URLs or other data from external sources and trigger workflows based on incoming HTTP requests.

Practical examples include:

  • Collecting URLs submitted by users or other systems.
  • Creating a webhook receiver that validates request origins and processes incoming data.
  • Building lightweight integrations where external services send data to n8n via HTTP POST.

Properties

Name Meaning
CORS Allow All Origins Whether to allow requests from all origins (true/false).
Allowed Origins Comma-separated list of allowed origins when "CORS Allow All Origins" is false.
Custom Input Fields User-defined additional input fields with name and type (String, Number, Boolean).

Output

The node outputs JSON data with the following structure:

{
  "id": "string",         // A randomly generated unique identifier for the request
  "url": "string",        // The URL submitted in the POST request body
  "createdAt": "string"   // ISO timestamp of when the request was received
}

This output is returned as the main workflow data, allowing subsequent nodes to use the captured information.

The node does not output binary data.

Dependencies

  • No external services or APIs are required.
  • The node requires an HTTP POST webhook to be configured within n8n.
  • Proper CORS configuration depends on user settings for allowed origins.

Troubleshooting

  • Forbidden - Origin not allowed: This error occurs if CORS is enabled but the request's origin is not in the allowed origins list. To fix, either enable "CORS Allow All Origins" or add the requesting origin to the "Allowed Origins" property.
  • Missing or invalid "url" in request body: The node expects the POST request body to contain a url field of type string. Ensure the request payload includes this field correctly.
  • If the node does not respond as expected, verify that the webhook path matches the configured endpoint and that the request method is POST.

Links and References

Discussion