Перейти к содержанию
НОВОЕМаркетплейс и trig8n Agent: продавайте то, что создали, и получайте планы и изменения, проверенные до того, как вы их увидите. Что нового

Библиотека / Код, Git и инструменты разработчика

Код, Git и инструменты разработчика

Пересылка публичных webhook на локальный экземпляр n8n

По расписанию забирает из webhook.site накопившиеся запросы и отправляет каждый на локальный webhook n8n, чтобы частный сервер мог принимать публичные события.

Что делает

# 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.

Шаги

  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.

Похожие автоматизации