Railway Deployer
Infrastructure engineer specializing in Railway platform deployments and service configuration.Quick Reference
| Property | Value |
|---|---|
| Domain | DevOps |
| FORGE Stage | 4 (DEPLOY) |
| Version | 1.0.0 |
| Output Types | railway.json, deployment configs |
Overview
Use this agent when you need to:
- Deploy Hono APIs or Next.js apps to Railway
- Configure environment variables and secrets
- Set up PostgreSQL or Redis plugins
- Configure domains, SSL, and health checks
- Manage multi-environment deployments (staging, production)
Core Capabilities
Service Configuration
Define Railway services with proper resource allocation, build commands, and replica counts
Environment Management
Configure variables per environment with secret references and plugin linkage
Network Setup
Configure custom domains, internal networking, SSL certificates, and health checks
Database Provisioning
Set up PostgreSQL, Redis, and other Railway plugins with optimal configurations
When to Use
Deploying SO1 Control Plane API (Hono backend)
Deploying SO1 Console (Next.js frontend)
Setting up staging and production environments
Configuring PostgreSQL or Redis for an application
Setting up health check endpoints
Managing Railway environment variables
Usage Examples
- Deploy Hono API
- Deploy Next.js Frontend
- Multi-Environment Setup
Deploy the SO1 Control Plane API with PostgreSQL and Redis:Result: Complete Railway configuration for production API deployment with database, caching, and health checks.
Outputs
Railway Configuration File
Health Check Implementation
Resource Sizing Guide
| Application Type | Memory | CPU | Replicas |
|---|---|---|---|
| API (light) | 256MB | 0.25 | 1 |
| API (standard) | 512MB | 0.5 | 2 |
| API (heavy) | 1GB+ | 1+ | 2+ |
| Next.js SSR | 512MB-1GB | 0.5-1 | 2 |
| Static site | 256MB | 0.25 | 1 |
| Worker/Cron | 256MB | 0.25 | 1 |
FORGE Gate Compliance
Entry Gates (Pre-conditions)
Application code passing CI checks
Application code passing CI checks
The application must have successfully passed all CI pipeline tests, linting, and build steps before deployment configuration begins.
Environment variables documented
Environment variables documented
All required environment variables must be listed in
.env.example with descriptions of their purpose and where to obtain values.Railway project exists or creation approved
Railway project exists or creation approved
Either the Railway project already exists in the Railway dashboard, or there is explicit approval to create a new project.
Exit Gates (Post-conditions)
Railway service configuration complete
Railway service configuration complete
The
railway.json file is created with proper build commands, deploy settings, and resource allocation.Environment variables configured
Environment variables configured
All environment variables are set in Railway dashboard with proper references to plugins and shared secrets.
Health check endpoints verified
Health check endpoints verified
The
/health endpoint returns 200 OK and validates database/Redis connectivity.Deployment successful and healthy
Deployment successful and healthy
The deployment completes without errors, health checks pass, and the service is accessible via its public domain.
Integration Points
Control Plane API
Veritas Prompts
- Consumed Prompts
- Produced Prompts
| Prompt ID | Purpose |
|---|---|
vrt-g7h8i9j0 | Railway deployment best practices (service config, scaling, networking) |
vrt-k1l2m3n4 | Container optimization guidelines (build optimization, image size, startup time) |
Related Agents
| Agent | Relationship | Use Case |
|---|---|---|
| GitHub Actions Engineer | Upstream | Triggers deployment after CI passes |
| Pipeline Auditor | Downstream | Reviews deployment config for security issues |
| Incident Commander | Alerts | Receives alerts on deployment failures |
| Hono Backend | Creates | Builds the APIs that Railway Deployer deploys |
Source Files
View Agent Source
Repository:
Path:
Version: 1.0.0
so1-io/so1-agentsPath:
agents/devops/railway-deployer.mdVersion: 1.0.0
Common Patterns
Variable Reference Syntax
Rollback Procedure
Common Deployment Errors
| Error | Cause | Resolution |
|---|---|---|
| Build failed | Missing dependencies or build error | Check build logs, verify package.json |
| Health check timeout | App not starting in time | Increase timeout, check startup logs |
| OOM killed | Memory limit exceeded | Increase memory allocation |
| Deploy stuck | Health check never passes | Verify health endpoint returns 200 |
| Variable missing | Secret not configured | Add missing variables in Railway dashboard |
Next Steps: