Bring your own Railway account, code and compute.
Deploy your worker to Railway
GetRatchet does not host your tool code. You own the Railway account, source code, compute bill and destination credentials. Never send destination credentials to GetRatchet or place them in tool payloads.
- Copy
examples/railway-workerto your own repository. Its only handler is the clearly markedgetratchet_echo@1example; replace it with your application code. - Create an environment-scoped WORKER key in GetRatchet Settings, allowlisting only your exact handler names and versions. Store it as
RATCHET_WORKER_KEYin your Railway service variables. Do not commit it. - Set
RATCHET_BASE_URLtohttps://getratchet.app, andRATCHET_WORKER_IDto a stable, unique identifier of at least eight characters for this single replica (e.g.orders-worker-production-1). Reuse it across restarts with the same key. Separate replicas need distinct IDs.PORTis supplied by Railway, default 8080. - Railway uses the starter's
Dockerfileandrailway.json./healthis the readiness endpoint. Start with one replica; increase concurrency deliberately inindex.js. SIGTERM/SIGINT stops polling and drains accepted handlers; allow termination grace exceeding the longest handler timeout, or expect lease expiration/retry. - Give the agent a separate INGEST key; the worker must never receive an ADMIN key. Keep destination-specific secrets in your own Railway variables and access them only inside your handler.
- Enqueue a disposable echo job and confirm successful inspection in GetRatchet. Then replace echo with your own handler and matching allowlist before accepting real work.
Executions are at least once. Use context.idempotencyKey at the destination (including database uniqueness constraints or provider idempotency headers) to avoid duplicate side effects. A crash, lease loss or forced shutdown can repeat an operation even when GetRatchet has not recorded a result.
The onboarding button uses NEXT_PUBLIC_RAILWAY_WORKER_TEMPLATE_URL. Operators must publish and verify their own Railway template based on this starter, then configure its HTTPS URL. With no template configured, the button opens this guide. No template or customer resource is created by the application.
For the complete architecture, read durable background jobs for Vercel applications.