10 months ago
I want to open this thread because I don't know if there is currently a way to invoke a serveless function other than making an HTTP request. I'm also not sure if we currently have a Railway sdk or library available that allows this kind of invocation, it would be great to be able to do it, maybe doing it through the generation of an API token or something similar. If there is any way to do it as I mentioned, please share it with me or if it is in the pipeline of next features.
Again, I think I could still do it using HTTP but it seems to me more lean to do it something similar as it is done with Lambda functions and I would like to confirm this.
2 Replies
9 months ago
As of now (June 2025), Railway functions (their "Function" services) are designed to be invoked via HTTP requests.
There is no official Railway SDK, CLI, or direct API method (like AWS Lambda’s Invoke API) to call these functions in any other way.
HTTP is currently the only supported invocation method for Railway functions. No official SDK or internal API for invoking functions directly. No native non-HTTP triggers like event bridge, queue, or CLI. You can make your own wrapper library or SDK (basically just a thin HTTP client).
AWS Lambda can be invoked by HTTP (API Gateway), AWS SDK/CLI, queues, or events. Railway Functions: HTTP only, no SDK or direct invocation yet.
-If you want SDK-like behavior: Just write a thin client that does HTTP with auth.
-If you need “internal-only” access: Restrict your function to check for an internal token in headers.
-If you want more, upvote/request this on the Railway roadmap-this is a common request!
9 months ago
Yeah, totally get where you're coming from.
Right now, Railway doesn't have an SDK like AWS Lambda's where you can invoke functions programmatically from inside your code (e.g., invoke("function-name") style). Everything is still done through HTTP requests — your serverless functions are just regular endpoints, so triggering them means hitting the public URL like any other API.
As for auth — there’s no built-in Railway SDK with token management or signed requests yet. So if you want to keep your function private or restrict access, you’d need to roll your own token check (like using a secret header or API key), or put your functions behind something like Cloudflare Access.
Would be nice to have a "Railway SDK" in the future with support for secure, internal function calls — but as of now, it’s just HTTP + your own auth layer.
Would def upvote something like that if it shows up on the roadmap!