Library / Code, Git & Developer Tools
Code, Git & Developer Tools
Relay Public Webhooks to a Local n8n Instance
On a schedule, it fetches queued requests from webhook.site and posts each one to a local n8n webhook so a private server can receive public events.
What it does
# Public Webhook Relay ## How it Works Utilizes webhook.site to receive public webhook requests and relays them to your local n8n workflow ## How to Use - To use with local key-value store: Go to settings > community nodes and enter @horka.tv/n8n-nodes-storage-kv to install the key-value store node - To use with a different storage method: Replace the four key-value nodes with a temporary storage option of your choice (Airtable, Notion, Firebase, etc). This is required to save data between runs. - Set Schedule Trigger with a polling interval (default is every 10 seconds). - Set your local workflow address in Local Webhook Address. ## How to Test - Set the workflow to *Active*. - After workflow executes at least once, you can check the input to Get Latest Requests for your auth token. - Run this command: curl -X POST -H "Content-Type: application/json" -d '{"foo":"bar"}' {{ $env.WEBHOOK_URL }}[THE AUTH TOKEN YOU JUST GOT] - Now check Executions and confirm that the workflow ran all the way to the end. Confirm in Unprocessed Requests that your data was retrieved (data[0].content should be equal to {"foo":"bar"}) - Now check your other local workflow and confirm that it was triggered with the correct data packet {"foo":"bar"}. - *You're done!* ## Caveats At present, the relay expects a POST with form/json data. If you wish to relay raw data or GET requests, please alter the Unprocessed Requests and POST to n8n nodes accordingly.
The steps
- Schedule Trigger
- Get Auth Token
- Unprocessed Requests
- Get Latest Requests
- POST to n8n
- Merge
- Local Webhook Address
- Latest Update Time
- Store Auth Token
- Store Last Processed
- Retrieve Auth Token
- Retrieve Last Processed
- If Auth Token Exists
- Error Handler
41 steps in total.
Similar automations
Code, Git & Developer ToolsFetch the Public IP Address of Your n8n Instance5 stepsCode, Git & Developer ToolsRelay Public Webhooks to a Local n8n Instance13 stepsCode, Git & Developer ToolsClone n8n Workflows Between Instances with the n8n API14 stepsCode, Git & Developer ToolsTest n8n Webhooks Without Changing the Webhook URL92 steps