Get the domain from the n8n url

I have n8n installed on my VPS, and I want to get the URL by a variable, I know that when I use the webhook trigger I can get the domain url, but I want to get it without depending on the webhook node

Hey @Ruan17,

There isn’t an expression I can see for this but if you enabled env options in expressions you could grab it that way. What are you actually trying to do though there could be other ways to handle it.

how can i enable env expression?

I’m building a flow where I make a request to a webhook from another flow of mine, so I want to leave the value of my domain dynamic, and getting the url of my domain will help me

Hey @Ruan17,

You can set N8N_BLOCK_ENV_ACCESS_IN_NODE to false if you currently have it set to true then you can use {{ $env["WEBHOOK_URL"] }} which will output the WEBHOOK_URL env option.

What you should be able to use is the environment variable that got created for the Wait-Node: $execution.resumeUrl.

It returns more than you want. Something like this:
https://xxx.n8n.whatever/webhook-waiting/702576
but you can then simply cut what you do not need away.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.