Public Webhook Relay

This workflow receives external POST requests through a public Webhook and automatically forwards them to local processes. It periodically polls for new requests, automatically manages authorization tokens and request statuses, ensuring reliable data transmission. Users can securely receive and process Webhook notifications in a local environment without the need to set up a public server, making it suitable for various scenarios such as development, testing, and data forwarding, significantly improving work efficiency and lowering technical barriers.

Workflow Diagram
Public Webhook Relay Workflow diagram

Workflow Name

Public Webhook Relay

Key Features and Highlights

This workflow leverages the public webhook receiving interface provided by webhook.site to automatically forward external POST requests to a local n8n workflow. It supports scheduled polling to check for new requests, automatic management of access tokens and request statuses, ensuring reliable transmission of request data.

  • Automatically obtains and stores authorization tokens
  • Scheduled polling (default every 10 seconds) to detect new webhook requests
  • Filters unprocessed POST requests to avoid duplicate handling
  • Forwards request content intact to a specified local webhook endpoint
  • Supports local persistent storage (based on the community Key-Value storage node)
  • Fully visualized workflow for easy debugging and extensibility

Core Problem Addressed

Solves the challenge of exposing a public webhook endpoint directly from a local environment by using webhook.site as a public entry point. This enables secure relay and forwarding of external requests without the need for complex public server deployment or security configurations, thereby improving development and testing efficiency.

Use Cases

  • Receiving external webhook notifications in local development or private intranet environments
  • Testing webhook data sent by third-party services without setting up a public server
  • Quickly building a webhook relay service integrated into existing n8n automation workflows
  • Debugging and forwarding data for enterprise intranet system external interfaces

Main Workflow Steps

  1. Schedule Trigger: Initiates the workflow on a schedule, defaulting to every 10 seconds
  2. Reads the locally stored authorization token and checks its existence
  3. If no token is found, calls the webhook.site API to obtain a new token and stores it
  4. Uses the token to query the latest request data from webhook.site
  5. Filters unprocessed POST requests based on timestamp and request method
  6. Aggregates and processes the filtered request data
  7. Records the timestamp of the latest processed request for subsequent filtering
  8. Forwards the request content via HTTP POST to the locally configured webhook URL
  9. Completes data relay and waits for the next polling cycle

Involved Systems or Services

  • webhook.site: Public webhook receiving and storage service
  • n8n Community Key-Value Storage Node (@horka.tv/n8n-nodes-storage-kv): Used for local persistent storage of authorization tokens and last processed timestamps
  • n8n HTTP Request Node: Handles API calls to webhook.site and request forwarding
  • Local n8n workflow webhook endpoint

Target Users and Value

  • Automation developers and test engineers: Receive and test external webhook requests without requiring a public network environment
  • Enterprise internal development teams: Securely and reliably forward intranet webhook data, minimizing public exposure risks
  • Users needing to quickly set up webhook relay services: Enables rapid configuration with reduced technical barriers
  • Users aiming to integrate external webhook data into local n8n workflows

This workflow provides a concise and efficient solution for receiving webhooks in local environments by securely relaying requests through webhook.site. Combined with local storage for accurate data management, it suits a variety of automation and testing scenarios, significantly enhancing work efficiency.