Railway + N8n + Webhook
Project ID: a9100ffc-bdab-46f7-bf05-dd9b6999cd5e
If I try to use webhook automation or invite a user to N8N the base url will be:
http://localhost:5678/
I set up a subdomain in the Railway project where I can use the app, but the internal URLs are localhost. How do I change the base URL?
Replace localhost with your backend URL from railway.
But I get error: Error: connect ETIMEDOUT 104.196.232.237:5678
14 Replies
Project ID:
a9100ffc-bdab-46f7-bf05-dd9b6999cd5e
Replace localhost with your backend URL from railway.
⚠️ experimental feature
You need to add the WEBHOOK_URL env variable and add the domain where you are hosting the n8n instance.
hi, i am trying to add the webhook URL as env variable as you suggested - should i just add the public URL part or even the port number. for me, i tried to add, but still I see only localhost URL in my webhook
you would want to use the
RAILWAY_PUBLIC_DOMAIN
in a template variable, you also must use https, like so
https://${{RAILWAY_PUBLIC_DOMAIN}}
thanks. i updated this and the redeploy happened. I created a new workflow and tried again - still the same timeout
https://n8n-production-bef4.up.railway.app:5678/webhook-test/8570aec2-5e82-4814-8f08-9ce807419491
show us the variable you set?
also, you have a port in that url, you can't access a railway service from anything other than port 443 externally
that is really helpful pointer - i forgot that only 443 is accessible outisde - the template epxposes 5678. i feel that the template is NOT properly designed - as a total beginner to railway and n8n, who is looking to evaluate n8n, these roadblocks are discouraging - is there a guide to get upto speed on railway for deploying n8n or just some simple python code that i want to expose as an API - i have been going through the docs from beginning, but it is just too technical and broadbased...
the template may expose 5678, but if you set it up right railway would proxy 5678 <--> 443
if you want help sorting out your n8n problems you are welcome to open your own thread.
as for simple python apis on railway, heres a few templates for that
https://railway.app/template/Rj_70k
https://railway.app/template/zUcpux
https://railway.app/template/-NvLj4
Also I do want to note, the templates are maintained by the community and are effectively open source. Railway is not responsible for their operation
If you feel that something is wrong with the template, get in contact with the template owner. They're very likely in this discord
Thanks Adam. I understand that templates are maintained by the community - but they are the first things that many of your new users encounter - so, it would be helpful if you do some quality checks on the templates at least after some of the issues are reported here - also, please prune the templates so that there is only one - for n8n, i saw 2 and there is no way to know what the difference between is - i was quite excited about railway.app, but have been bogged down due to many template errors in 2 or 3 templates I tried - n8n, nocodb. Just a feedback, please do not take it as a criticism...
Brody, thanks for the link to the latest FastAPI template. I used this template and set up a project and i am testing some post API - i installed the railway CLI and linked the project. after that, how do I run the fastAPI project locally as if it runs in railway? i wanted to test whether all my dependencies are included - this time, i forgot to put pandas in my requirements.txt and it threw an error in railway while automatically deploying - i want to avoid this in the future.
you can't run commands on railway, watch this video please
https://youtu.be/oLlT6c6jA-M?si=aiu4kHfQvdS3MYqr
Brody, thanks for the link - i know about requirements.txt and how to use them, but i am talking about a different kind of a problem - forgetting to update the requirements.txt when we commit - that is why i switched to pipenv, which works like npm. you don't have to manage the dependencies list manually.
Anyway, i have been going through all the docs and error messages of railways and slowly understanding things - now, I got it to work with pipenv...
awesome!!