Webhook url

Hello everyone.
I have a question regarding the URL for the webhook.
I have an automation that runs from a sheeta. Running automation from sheet stops working every now and then. As a rule, the repair of such automation is that it updates the webhook link. I wonder why this is happening and there are two options. The first option is that I accidentally changed the webhook and thus the address for this automation has changed. The second option is that the addresses for the webhooks change themselves from time to time.
Which option is correct?

Hello @Max_T,
I am not able to understand your problem fully.

If you use the Webhook node the test/production urls do not change themselves. They would only change if you

  • Change the webhook path parameter
  • Change the environment variable WEBHOOK_URL
  • Change the configuration of your edge router in regards to webhook urls

What does that mean? Can you provide a sample workflow?

I have a macro that I run from sheet

function WysylanieplikownaGoogleMyBusiness() {

var response = UrlFetchApp.fetch("https://sdgdsgd345345435435xeta.hooks.n8n.cloud/webhook/b4c3asdfsdfsdf-345345345345sdgfsdgsdgsd0?set=1");

Browser.msgBox(response.getContentText());
}

The url is from the webhook. The piece “? Set = 1” has no meaning, no role. In theory, after using a URL in this macro, the automation should work every time. In practice, I have to update the Makro URL from time to time. When I notice that the automation is not working, when I enter the scenario, it turns out that the webhook has a different URL. I don’t change the webhook URL myself, unless I do it by accident.

this is my use of the webhook :point_up:

Hey @Max_T,

If you are using n8n desktop or n8n with the tunnel option the generated URL can change, Because of this we don’t recommend using it for a production workflow. Instead if you needed a URL that is static you would need to either use your own URL or use a service like ngrok and set the WEBHOOK_URL environment variable to match the URL you have control over.

I don’t think I turned on the tunnel. Where can I check it?

How are you running n8n?

I have n8n on my computer, but I don’t think I turned on the tunnel option.

So if I have an n8n desktop, I would have to use ngrok?
Is ngrok safer for my computer?

Hey @Max_T,

If it is n8n desktop something like ngrok would do the job unless you had your own domain and wanted to do some port forwarding.

As for if it is safer… it depends on what you mean by safer. ngrok was just the first one I thought of but there are a few services that do what ngrok does.

I did make a very quick guide last year before I started here on how you can configure desktop to use ngrok which you can find here: N8n Desktop custom Webhook url ngrok - #4 by Jon

Is the ngrok free version enough to solve my problem ?

It looks like Pro would be needed to provide a custom URL but I am not sure on permanent urls with the ngrok domain that would need to be checked with them.

It seems to me that using my own address (I mean the computer) will not work, because I do not have a fixed IP address. I am not sure if the end point is enough or if I need a domain in ngrok. Which should I choose?

Hey @Max_T,

That is up to you really, The other option would be to restart the desktop app and just keep an eye on the domain.

ngrok is probably the easier option if the domain doesn’t change but it really does come down to preference.

will that be good too?

Hookdeck would be good if you have a lot of webhooks coming in and need to have greater control over those.
For your use case I think it will be overkill.
Also as the issue is that you do not have an external address, this will not fix your issue.
Easiest way would to simply get a n8n cloud instance going and do your thing there.

do ngrok and hookdeck work similarly?

no
ngrok is a tunneling service
hookdeck is webhook management.

will webhooks with ngrok point to my computer. I am afraid of hacker attacks