Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

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

  1. Schedule Trigger
  2. Get Auth Token
  3. Unprocessed Requests
  4. Get Latest Requests
  5. POST to n8n
  6. Merge
  7. Local Webhook Address
  8. Latest Update Time
  9. Store Auth Token
  10. Store Last Processed
  11. Retrieve Auth Token
  12. Retrieve Last Processed
  13. If Auth Token Exists
  14. Error Handler

41 steps in total.

Similar automations