> ## Documentation Index
> Fetch the complete documentation index at: https://opensre.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Railway

> Configure Railway deployment inspection and confirmed service redeploys

## Overview

The Railway integration inspects the latest successful deployment of any configured Railway service and can request a redeploy after explicit confirmation.

## Setup

Install the Railway CLI, then either authenticate it interactively or configure a Railway token:

```bash theme={null}
npm install -g @railway/cli
railway login
opensre integrations setup railway
```

The setup flow accepts an optional token and default project, service, and environment. The token is used when present; an authenticated Railway CLI can be used without one. Tool calls can override any configured default scope.

Environment configuration is also supported:

```bash theme={null}
RAILWAY_TOKEN=
RAILWAY_PROJECT=project-id-or-name
RAILWAY_SERVICE=service-id-or-name
RAILWAY_ENVIRONMENT=production
RAILWAY_PATH=railway
```

Verify the local integration with:

```bash theme={null}
opensre integrations verify railway
```

## Tools

| Tool                         | What it does                                                                                      | Confirmation         |
| ---------------------------- | ------------------------------------------------------------------------------------------------- | -------------------- |
| `inspect_railway_deployment` | Shows the latest successful deployment and available source commit metadata for a Railway service | No                   |
| `redeploy_railway_service`   | Requests a Railway service redeploy                                                               | Yes (`confirm=true`) |

### Inspect a deployment

When a default scope is configured, no parameters are required. Otherwise provide the service scope:

```json theme={null}
{
  "project": "project-id-or-name",
  "service": "service-id-or-name",
  "environment": "production"
}
```

The result includes deployment ID, status, and source commit hash/message when Railway provides them.

### Redeploy a service

```json theme={null}
{
  "project": "project-id-or-name",
  "service": "service-id-or-name",
  "environment": "production",
  "confirm": true
}
```

`confirm` must be explicitly `true`. Railway reuses the latest deployment and returns its new deployment ID. Commands always use explicit project, service, and environment flags and never write Railway link state into the workspace.

## Errors and security

* `deployment_unavailable` means Railway returned no successful deployment in the inspected history.
* `confirmation_required` means redeploy was called without `confirm=true`.
* Missing configuration, CLI, or authentication failures return structured errors.
* Railway tokens are never returned in tool output; Railway commands are non-interactive and errors are redacted.
