Skip to main content

Serverless Functions

Deploy individual functions as HTTP endpoints with zero infrastructure management. Functions scale to zero when idle, boot in milliseconds, and bill per invocation -- ideal for webhooks, scheduled tasks, lightweight APIs, and event handlers.

Use cases

Use CaseDescription
WebhooksHandle Stripe, GitHub, or any third-party webhook with zero cold-start concern.
Cron tasksRun scheduled data jobs, reports, or cleanup routines without a persistent process.
API endpointsLightweight REST endpoints that only run when called.
Event handlersReact to RailPush deploy events, queue messages, or database triggers.

Supported runtimes

  • Node.js 20
  • Python 3.11

Limits

LimitValue
Execution timeout30 seconds
Memory512 MB
Request payload6 MB
ConcurrencyUnlimited (scale to zero)

Create a function

API
curl -X POST https://railpush.com/api/v1/functions \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "process-webhook",
"runtime": "node20",
"source_type": "git",
"repo": "acme/webhooks",
"branch": "main",
"handler": "index.handler"
}'

# Response:
# {
# "id": "fn-...",
# "invoke_url": "https://fn-process-webhook.railpush.com",
# "status": "deploying"
# }

Invoke a function

curl
# HTTP POST with JSON body
curl -X POST https://fn-process-webhook.railpush.com \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{"event": "payment.succeeded", "amount": 4900}'

# HTTP GET with query params
curl "https://fn-process-webhook.railpush.com?id=123"

API reference

MethodEndpointDescription
POST/api/v1/functionsCreate a function
GET/api/v1/functionsList all functions
GET/api/v1/functions/:idGet function details
PATCH/api/v1/functions/:idUpdate function config
DELETE/api/v1/functions/:idDelete a function
POST/api/v1/functions/:id/invokeInvoke synchronously (returns response)