Feedback: Railway Functions

4 months ago

As part of Launch Week 02, we have shipped Railway Functions

Write and deploy code from the Railway canvas without managing infrastructure or creating a git repository. Functions are Services that run a single file of TypeScript code using the Bun runtime. Use them like any other Service, but without the overhead of a repository.

To make a Function Service, click New Service on the canvas and then click "Function" - you will then see the editor.

They are ideal for small tasks like handling webhooks, cron jobs, or simple APIs. (Or larger ones like cleaning data.)

This is a feedback thread to keep track of asks about this feature.

Some known caveats:

  • You can't railway up your function file

  • 1 file per function

  • Max file size of 96KB

Roast 'em

In Progress

0 Threads mention this feature

12 Replies

Status changed to In Progress angelo 4 months ago


andreaselia
PRO

4 months ago

Awesome launch! I take it Railway Functions are designed, as you said, for small tasks, rather than something like runnning Puppeteer or anything else which is heavy that requires additional setup for an image install, etc. that can be ran as its own service?


malonehedges
PRO

4 months ago

Love Railway, love Bun, and love functions! Love this update!

A couple requests:
- pushing changes from a file on my computer (I'm more comfortable in my editor, I like versioning with GitHub / collaborating, and I want LLMs to write this code for me)
- if not above, LLM help (with some copy/paste instructions on how the import syntax / version pinning works, best practices that make sense for an LLM to have as context when writing one of these functions)
- Vim bindings in the dashboard
- Very clear versioning of Bun, which is less important if Bun is always up to date (Bun releases new features all the time currently, and with Nixpacks in the past I wasn't able to use a new feature and changed my build system to be Docker)

Overall very excited! Thanks Railway team!


markvh033
HOBBY

4 months ago

I like it! more examples and documentation will always be appreciated so people can quickly get going.

An issue im running into now is:

error: Failed to start server. Is port 8080 in use?

syscall: "listen",

errno: 0,

code: "EADDRINUSE"

at bun:main:12:28

Another container is already using 8080, but cant find where i can change the port.


Anonymous
TRIAL

4 months ago

Does the Railway Function support Python? I have a cron job running Python code and am exploring integration options. Let me know if this is possible.


andreaselia

Awesome launch! I take it Railway Functions are designed, as you said, for small tasks, rather than something like runnning Puppeteer or anything else which is heavy that requires additional setup for an image install, etc. that can be ran as its own service?

4 months ago

Yes, we would say bring an image for that.


Does the Railway Function support Python? I have a cron job running Python code and am exploring integration options. Let me know if this is possible.

4 months ago

Not yet, but it's likely the second language we'd support.


malonehedges

Love Railway, love Bun, and love functions! Love this update!A couple requests:- pushing changes from a file on my computer (I'm more comfortable in my editor, I like versioning with GitHub / collaborating, and I want LLMs to write this code for me)- if not above, LLM help (with some copy/paste instructions on how the import syntax / version pinning works, best practices that make sense for an LLM to have as context when writing one of these functions)- Vim bindings in the dashboard- Very clear versioning of Bun, which is less important if Bun is always up to date (Bun releases new features all the time currently, and with Nixpacks in the past I wasn't able to use a new feature and changed my build system to be Docker)Overall very excited! Thanks Railway team!

jaredlunde
EMPLOYEE

4 months ago

This stays between us shh, but you can cmd+option+v or ctrl+alt+v in the editor to enable vim mode.

Thanks for all the feedback : ) We are working on some of these things.


Does the Railway Function support Python? I have a cron job running Python code and am exploring integration options. Let me know if this is possible.

3 months ago

co asking because that would be awesome!!!!!


angelo

Not yet, but it's likely the second language we'd support.

3 months ago

yes please!


lukashirt
PRO

3 months ago

Great concept! What I would really love is to replace my cron jobs with Railway functions. Currently I have a few simple cron jobs that are only calling API endpoints and if I could schedule a Railway function for this, I would be a happy man. Having to create a GH repo, commit & push the code is of course manageable but if I could just write a simple fetch function, set a schedule and be done with that, that would be something awesome! Unfortunately it says "Cron schedules are not available for serverless services." right now.


lukashirt

Great concept! What I would really love is to replace my cron jobs with Railway functions. Currently I have a few simple cron jobs that are only calling API endpoints and if I could schedule a Railway function for this, I would be a happy man. Having to create a GH repo, commit & push the code is of course manageable but if I could just write a simple fetch function, set a schedule and be done with that, that would be something awesome! Unfortunately it says "Cron schedules are not available for serverless services." right now.

jaredlunde
EMPLOYEE

2 months ago

It's a poorly worded warning, sorry about that. You can certainly use Railway Functions for cron services. You just need to make sure that the "Enable Serverless" setting is off.

Attachments


techgosafeagency
HOBBY

a month ago

Hi, I have already opened a thread about this, but there is in the project planning maybe an implementation of an SDK or library to be able to perform actions against the functions (like invoking them or even uploading new functions, or other kind of actions).

Great job out there!