# Railway

> Run your Railway apps from workflows: deploy, redeploy, restart and roll back services, read their logs, change their variables, and create projects and environments.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/railway

## Actions

### Add public web address

Give a service a public web address on up.railway.app, so anyone can open it.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Port (`port`, number): The port the app listens on. Leave blank to let Railway find it. From 1 to 65535.

**Outputs**

- `domain` (text): The address, such as web-production.up.railway.app
- `domain_id` (text): The address's id in Railway
- `environment_id` (text): The environment
- `port` (number): The port it sends visitors to
- `service_id` (text): The service
- `url` (text): The address as a link

**Example output**

```json
{
  "domain": "web-production-4c74b.up.railway.app",
  "domain_id": "0ae6f738-d6e7-429e-b07b-0b4c44620b33",
  "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "port": 80,
  "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
  "url": "https://web-production-4c74b.up.railway.app"
}
```

### Create environment

Create an environment, such as staging, empty or as a copy of another one's services and variables.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Name (`name`, text, required): The environment's name.
- Copy from (`copy_from`, text): Start with this environment's services and variables. Leave blank for an empty environment.

**Outputs**

- `copied_from` (text): The environment it copies, if any
- `created_at` (text): When it was created
- `environment_id` (text): The new environment
- `name` (text): Its name
- `project_id` (text): Its project

**Example output**

```json
{
  "copied_from": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "created_at": "2026-10-19T21:31:20.004Z",
  "environment_id": "d84a766e-b025-480b-99a0-ea231055b182",
  "name": "staging",
  "project_id": "3997a405-8630-406a-8c50-5e1af74d0142"
}
```

### Create project

Create an empty project with a production environment.

**Inputs**

- Name (`name`, text, required): The project's name.
- Description (`description`, text): What the project is for.

**Outputs**

- `environment_id` (text): Its production environment
- `environment_name` (text): That environment's name
- `project` (object): The new project

**Example output**

```json
{
  "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "environment_name": "production",
  "project": {
    "created_at": "2026-10-19T21:27:01.112Z",
    "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142",
    "description": null,
    "name": "billing-api",
    "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
    "updated_at": "2026-10-19T21:27:01.112Z"
  }
}
```

### Create service

Add a service to a project from a Docker image or a GitHub repo, and deploy it.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Deploy from (`source`, text, required): Where the service's code comes from. One of: `image` (Docker image), `repo` (GitHub repo). Default: `image`.
- Docker image (`image`, text): A public image, such as nginx:alpine or ghcr.io/owner/app:latest. Only when Deploy from is Docker image.
- GitHub repo (`repo`, text): owner/app, or a github.com link. A private repo needs Railway's GitHub app to have access to it. Only when Deploy from is GitHub repo.
- Branch (`branch`, text): Leave blank for the repo's default branch. Only when Deploy from is GitHub repo.
- Name (`name`, text): Leave blank to name it after the image or repo.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Variables (`variables`, object): Settings the service reads when it runs, such as PORT or API_URL.

**Outputs**

- `dashboard_url` (text): The service in the Railway dashboard
- `deployment` (object): Its first deployment
- `environment_id` (text): The environment it was deployed to
- `environment_name` (text): That environment's name
- `name` (text): Its name
- `project_id` (text): Its project
- `service_id` (text): The new service

**Example output**

```json
{
  "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142/service/8b68fa86-5c75-44da-8768-abfeed29d4b0?environmentId=b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "deployment": {
    "branch": null,
    "can_redeploy": true,
    "can_roll_back": true,
    "commit": null,
    "commit_message": null,
    "created_at": "2026-10-19T21:40:50.173Z",
    "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142/service/8b68fa86-5c75-44da-8768-abfeed29d4b0?environmentId=b2e76bd7-9145-47c1-b444-b73c01b589ec&id=58a5ecaa-d003-4852-927b-a3e547ef5088",
    "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
    "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
    "environment_name": "production",
    "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
    "reason": "deploy",
    "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
    "service_name": "web",
    "source": "traefik/whoami",
    "status": "INITIALIZING",
    "status_label": "Running",
    "updated_at": "2026-10-19T21:40:58.211Z",
    "url": "https://web-production-4c74b.up.railway.app"
  },
  "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "environment_name": "production",
  "name": "web",
  "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
  "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0"
}
```

### Delete environment

Delete an environment and everything deployed in it. This can't be undone.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Environment (`environment`, text, required): The environment to delete. The main environment can't be deleted.

**Outputs**

- `deleted` (true/false): Whether Railway deleted it
- `environment_id` (text): The deleted environment

**Example output**

```json
{
  "deleted": true,
  "environment_id": "d84a766e-b025-480b-99a0-ea231055b182"
}
```

### Delete project

Delete a project with all its services, databases and environments. This can't be undone.

**Inputs**

- Project (`project`, text, required): The Railway project.

**Outputs**

- `deleted` (true/false): Whether Railway deleted it
- `project_id` (text): The deleted project

**Example output**

```json
{
  "deleted": true,
  "project_id": "3997a405-8630-406a-8c50-5e1af74d0142"
}
```

### Delete service

Delete a service and its deployments, everywhere or from one environment. This can't be undone.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Only in environment (`environment`, text): Delete the service from this environment only. Leave blank to delete it everywhere.

**Outputs**

- `deleted` (true/false): Whether Railway deleted it
- `environment_id` (text): The environment, when only one was chosen
- `service_id` (text): The deleted service

**Example output**

```json
{
  "deleted": true,
  "environment_id": null,
  "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0"
}
```

### Delete variable

Remove one variable from a service.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Variable (`variable`, text, required): The name of the variable to remove.

**Outputs**

- `deleted` (true/false): Whether Railway removed it
- `environment_id` (text): The environment
- `name` (text): The variable
- `service_id` (text): The service

**Example output**

```json
{
  "deleted": true,
  "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "name": "FEATURE_FLAG",
  "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0"
}
```

### Deploy service

Deploy a service now: the latest commit of its GitHub repo (or a chosen one), or its Docker image.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Commit (`commit`, text): For a GitHub service, the commit to deploy. Leave blank for the latest one.

**Outputs**

- `deployment` (object): The new deployment

**Example output**

```json
{
  "deployment": {
    "branch": null,
    "can_redeploy": true,
    "can_roll_back": true,
    "commit": null,
    "commit_message": null,
    "created_at": "2026-10-19T21:40:50.173Z",
    "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142/service/8b68fa86-5c75-44da-8768-abfeed29d4b0?environmentId=b2e76bd7-9145-47c1-b444-b73c01b589ec&id=58a5ecaa-d003-4852-927b-a3e547ef5088",
    "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
    "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
    "environment_name": "production",
    "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
    "reason": "deploy",
    "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
    "service_name": "web",
    "source": "traefik/whoami",
    "status": "BUILDING",
    "status_label": "Running",
    "updated_at": "2026-10-19T21:40:58.211Z",
    "url": "https://web-production-4c74b.up.railway.app"
  }
}
```

### Get deployment

Get a deployment's status, web address and commit, and why it failed if it did. Blank means the service's current deployment.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Deployment (`deployment`, text): Leave blank for the service's current deployment.

**Outputs**

- `deployment` (object): The deployment
- `error` (text): Why it failed, in Railway's words, when it failed

**Example output**

```json
{
  "deployment": {
    "branch": null,
    "can_redeploy": true,
    "can_roll_back": true,
    "commit": null,
    "commit_message": null,
    "created_at": "2026-10-19T21:40:50.173Z",
    "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142/service/8b68fa86-5c75-44da-8768-abfeed29d4b0?environmentId=b2e76bd7-9145-47c1-b444-b73c01b589ec&id=58a5ecaa-d003-4852-927b-a3e547ef5088",
    "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
    "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
    "environment_name": "production",
    "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
    "reason": "deploy",
    "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
    "service_name": "web",
    "source": "traefik/whoami",
    "status": "SUCCESS",
    "status_label": "Running",
    "updated_at": "2026-10-19T21:40:58.211Z",
    "url": "https://web-production-4c74b.up.railway.app"
  },
  "error": null
}
```

### Get deployment logs

Get the last lines a deployment's app or build printed, such as the error that made it fail.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Deployment (`deployment`, text): Leave blank for the service's current deployment.
- Logs (`logs`, text, required): What the app printed while running, or what the build printed. One of: `app` (App logs), `build` (Build logs). Default: `app`.
- Lines (`lines`, number): How many of the most recent lines. From 1 to 1000. Default: `100`.
- Containing (`search`, text): Only lines containing this text, such as error.

**Outputs**

- `count` (number): How many lines
- `deployment_id` (text): The deployment
- `lines` (list): The lines
- `logs` (text): app or build
- `status` (text): Its status
- `text` (text): The lines as one block of text

**Example output**

```json
{
  "count": 1,
  "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
  "lines": [
    {
      "message": "Starting Container",
      "severity": "info",
      "timestamp": "2026-10-19T21:40:53.503Z"
    }
  ],
  "logs": "app",
  "status": "SUCCESS",
  "text": "Starting Container"
}
```

### Get project

Get a project with its environments and services, and whether each service is running.

**Inputs**

- Project (`project`, text, required): The Railway project.

**Outputs**

- `environments` (list): Its environments
- `project` (object): The project
- `services` (list): Its services, as they are in the main environment

**Example output**

```json
{
  "environments": [
    {
      "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
      "is_main": true,
      "name": "production"
    }
  ],
  "project": {
    "created_at": "2026-10-19T21:27:01.112Z",
    "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142",
    "description": null,
    "name": "billing-api",
    "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
    "updated_at": "2026-10-19T21:27:01.112Z"
  },
  "services": [
    {
      "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142/service/8b68fa86-5c75-44da-8768-abfeed29d4b0?environmentId=b2e76bd7-9145-47c1-b444-b73c01b589ec",
      "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
      "name": "web",
      "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
      "status": "SUCCESS",
      "status_label": "Running",
      "url": "https://web-production-4c74b.up.railway.app"
    }
  ]
}
```

### List deployments

List a service's recent deployments, newest first, optionally only failed or crashed ones.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Status (`status`, list): Only deployments in these states. Leave blank for all. One or more of: `SUCCESS` (Running), `FAILED`, `CRASHED`, `BUILDING`, `DEPLOYING`, `INITIALIZING` (Starting), `QUEUED`, `WAITING`, `NEEDS_APPROVAL` (Needs approval), `SLEEPING`, and 3 more.
- How many (`limit`, number): How many deployments, newest first. From 1 to 100. Default: `20`.

**Outputs**

- `count` (number): How many deployments
- `deployments` (list): The deployments
- `environment_id` (text): The environment
- `service_id` (text): The service

**Example output**

```json
{
  "count": 1,
  "deployments": [
    {
      "branch": null,
      "can_redeploy": true,
      "can_roll_back": true,
      "commit": null,
      "commit_message": null,
      "created_at": "2026-10-19T21:40:50.173Z",
      "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142/service/8b68fa86-5c75-44da-8768-abfeed29d4b0?environmentId=b2e76bd7-9145-47c1-b444-b73c01b589ec&id=58a5ecaa-d003-4852-927b-a3e547ef5088",
      "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
      "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
      "environment_name": "production",
      "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
      "reason": "deploy",
      "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
      "service_name": "web",
      "source": "traefik/whoami",
      "status": "SUCCESS",
      "status_label": "Running",
      "updated_at": "2026-10-19T21:40:58.211Z",
      "url": "https://web-production-4c74b.up.railway.app"
    }
  ],
  "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0"
}
```

### List projects

List every project in the workspace, newest first.

**Inputs**: None.

**Outputs**

- `count` (number): How many projects
- `projects` (list): The projects

**Example output**

```json
{
  "count": 1,
  "projects": [
    {
      "created_at": "2026-10-19T21:27:01.112Z",
      "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142",
      "description": null,
      "name": "billing-api",
      "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
      "updated_at": "2026-10-19T21:27:01.112Z"
    }
  ]
}
```

### List variables

List a service's variables. The ones Railway adds itself are listed apart.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.

**Outputs**

- `count` (number): How many of your variables
- `environment_id` (text): The environment
- `railway_variables` (object): The variables Railway sets, such as its web address
- `service_id` (text): The service
- `variables` (object): Your variables

**Example output**

```json
{
  "count": 1,
  "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "railway_variables": {
    "RAILWAY_PUBLIC_DOMAIN": "web-production-4c74b.up.railway.app"
  },
  "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
  "variables": {
    "API_URL": "https://api.example.com"
  }
}
```

### Redeploy service

Build and deploy the same code again, as a new deployment. Use it to pick up changed variables or retry a failed build.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Deployment (`deployment`, text): Leave blank for the service's current deployment.

**Outputs**

- `deployment` (object): The new deployment
- `redeployed_from` (text): The deployment it copied

**Example output**

```json
{
  "deployment": {
    "branch": null,
    "can_redeploy": true,
    "can_roll_back": true,
    "commit": null,
    "commit_message": null,
    "created_at": "2026-10-19T21:40:50.173Z",
    "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142/service/8b68fa86-5c75-44da-8768-abfeed29d4b0?environmentId=b2e76bd7-9145-47c1-b444-b73c01b589ec&id=58a5ecaa-d003-4852-927b-a3e547ef5088",
    "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
    "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
    "environment_name": "production",
    "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
    "reason": "deploy",
    "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
    "service_name": "web",
    "source": "traefik/whoami",
    "status": "INITIALIZING",
    "status_label": "Running",
    "updated_at": "2026-10-19T21:40:58.211Z",
    "url": "https://web-production-4c74b.up.railway.app"
  },
  "redeployed_from": "47407a53-1ba0-4e15-a105-d552c32cbad7"
}
```

### Restart service

Restart a service's running deployment without building it again. Use it when the app is stuck.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Deployment (`deployment`, text): Leave blank for the service's current deployment.

**Outputs**

- `deployment_id` (text): The restarted deployment
- `restarted` (true/false): Whether Railway accepted it

**Example output**

```json
{
  "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
  "restarted": true
}
```

### Roll back service

Go back to an earlier deployment. Leave Deployment blank to go back to the last one that worked before the current one.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Deployment (`deployment`, text): Leave blank for the service's current deployment.

**Outputs**

- `rolled_back` (true/false): Whether Railway accepted it
- `rolled_back_to` (object): The deployment now being restored

**Example output**

```json
{
  "rolled_back": true,
  "rolled_back_to": {
    "branch": null,
    "can_redeploy": true,
    "can_roll_back": true,
    "commit": null,
    "commit_message": null,
    "created_at": "2026-10-19T21:40:50.173Z",
    "dashboard_url": "https://railway.com/project/3997a405-8630-406a-8c50-5e1af74d0142/service/8b68fa86-5c75-44da-8768-abfeed29d4b0?environmentId=b2e76bd7-9145-47c1-b444-b73c01b589ec&id=58a5ecaa-d003-4852-927b-a3e547ef5088",
    "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
    "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
    "environment_name": "production",
    "project_id": "3997a405-8630-406a-8c50-5e1af74d0142",
    "reason": "deploy",
    "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0",
    "service_name": "web",
    "source": "traefik/whoami",
    "status": "REMOVED",
    "status_label": "Running",
    "updated_at": "2026-10-19T21:40:58.211Z",
    "url": "https://web-production-4c74b.up.railway.app"
  }
}
```

### Set variables

Add or change a service's variables and redeploy it so they take effect. Other variables are left as they are.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Variables (`variables`, object, required): Variables to add or change. Others are left as they are.
- Redeploy now (`redeploy_now`, true/false): Redeploy the service so the change takes effect. Default: `true`.

**Outputs**

- `environment_id` (text): The environment
- `names` (list): The variables set
- `redeploying` (true/false): Whether the service is redeploying
- `saved` (true/false): Whether Railway saved them
- `service_id` (text): The service

**Example output**

```json
{
  "environment_id": "b2e76bd7-9145-47c1-b444-b73c01b589ec",
  "names": [
    "API_URL"
  ],
  "redeploying": true,
  "saved": true,
  "service_id": "8b68fa86-5c75-44da-8768-abfeed29d4b0"
}
```

### Stop deployment

Stop a service's running deployment, or cancel one that is still building or starting.

**Inputs**

- Project (`project`, text, required): The Railway project.
- Service (`service`, text, required): The service in that project.
- Environment (`environment`, text): Leave blank for the project's main environment.
- Deployment (`deployment`, text): Leave blank for the service's current deployment.

**Outputs**

- `action` (text): cancelled or stopped
- `deployment_id` (text): The deployment
- `done` (true/false): Whether Railway accepted it

**Example output**

```json
{
  "action": "stopped",
  "deployment_id": "58a5ecaa-d003-4852-927b-a3e547ef5088",
  "done": true
}
```
