# Railway (/integrations/railway)





{/* MANUAL-CONTENT-START:intro */}

Use [Railway](https://railway.com/) to list projects, inspect their services and environments, monitor deployments, deploy a service, or roll back a deployment. Read or update service and shared environment variables through Railway's public GraphQL API.

Use project, service, and environment IDs from lookup actions in later release steps. Confirm the target environment before changing variables or starting a deployment.

{/* MANUAL-CONTENT-END */}

## Use the block [#usage-instructions]

Integrate Railway into workflows to list projects, manage services and environments, monitor deployments, trigger and roll back service deployments, and manage environment variables.

## Actions [#actions]

### Railway List Projects [#railway-list-projects]

List Railway projects visible to the provided token

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `workspaceId` | string | No | Workspace ID to list projects from |
  | `first` | number | No | Maximum number of projects to return |
  | `after` | string | No | Cursor for pagination |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `projects` | array | Railway projects |
  | ↳ `id` | string | Project ID |
  | ↳ `name` | string | Project name |
  | ↳ `description` | string | Project description |
  | ↳ `createdAt` | string | Project creation timestamp |
  | ↳ `updatedAt` | string | Project update timestamp |
  | `pageInfo` | object | Pagination information |
  | ↳ `hasNextPage` | boolean | Whether more projects are available |
  | ↳ `endCursor` | string | Cursor for the next page |
  | `count` | number | Number of projects returned |
</ReferenceDetails>

### Railway Get Project [#railway-get-project]

Get a Railway project with its services and environments

<ReferenceDetails>
  #### Input [#input-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `project` | object | Project with services and environments |
  | ↳ `id` | string | Project ID |
  | ↳ `name` | string | Project name |
  | ↳ `description` | string | Project description |
  | ↳ `createdAt` | string | Project creation timestamp |
  | ↳ `updatedAt` | string | Project update timestamp |
  | ↳ `services` | array | Project services |
  | ↳ `id` | string | Service ID |
  | ↳ `name` | string | Service name |
  | ↳ `icon` | string | Service icon |
  | ↳ `environments` | array | Project environments |
  | ↳ `id` | string | Environment ID |
  | ↳ `name` | string | Environment name |
</ReferenceDetails>

### Railway Create Project [#railway-create-project]

Create a Railway project

<ReferenceDetails>
  #### Input [#input-2]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `name` | string | Yes | Project name |
  | `description` | string | No | Project description |
  | `workspaceId` | string | No | Workspace ID to create the project in |
  | `isPublic` | boolean | No | Whether the project should be publicly visible |
  | `defaultEnvironmentName` | string | No | Name for the default environment |
  | `prDeploys` | boolean | No | Whether to enable pull request deploys |

  #### Output [#output-2]

  | Parameter | Type | Description |
  | - | - | - |
  | `project` | object | Created project |
  | ↳ `id` | string | Project ID |
  | ↳ `name` | string | Project name |
</ReferenceDetails>

### Railway Update Project [#railway-update-project]

Update a Railway project name or description

<ReferenceDetails>
  #### Input [#input-3]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |
  | `name` | string | No | Updated project name |
  | `description` | string | No | Updated project description |
  | `isPublic` | boolean | No | Whether the project should be publicly visible |
  | `prDeploys` | boolean | No | Whether to enable pull request deploy environments |

  #### Output [#output-3]

  | Parameter | Type | Description |
  | - | - | - |
  | `project` | object | Updated project |
  | ↳ `id` | string | Project ID |
  | ↳ `name` | string | Project name |
  | ↳ `description` | string | Project description |
</ReferenceDetails>

### Railway Delete Project [#railway-delete-project]

Delete a Railway project

<ReferenceDetails>
  #### Input [#input-4]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |

  #### Output [#output-4]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the project was deleted |
</ReferenceDetails>

### Railway Transfer Project [#railway-transfer-project]

Transfer a Railway project to another workspace

<ReferenceDetails>
  #### Input [#input-5]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |
  | `workspaceId` | string | Yes | Destination workspace ID |

  #### Output [#output-5]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the project was transferred |
</ReferenceDetails>

### Railway List Project Members [#railway-list-project-members]

List members for a Railway project

<ReferenceDetails>
  #### Input [#input-6]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |

  #### Output [#output-6]

  | Parameter | Type | Description |
  | - | - | - |
  | `members` | array | Project members |
  | ↳ `id` | string | Member user ID |
  | ↳ `role` | string | Project role |
  | ↳ `name` | string | Member name |
  | ↳ `email` | string | Member email |
  | ↳ `avatar` | string | Member avatar URL |
  | `count` | number | Number of members returned |
</ReferenceDetails>

### Railway Create Environment [#railway-create-environment]

Create a Railway project environment

<ReferenceDetails>
  #### Input [#input-7]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |
  | `name` | string | Yes | Environment name |
  | `sourceEnvironmentId` | string | No | Environment ID to clone from |
  | `ephemeral` | boolean | No | Whether the environment is ephemeral |
  | `skipInitialDeploys` | boolean | No | Whether to skip initial deploys for the environment |
  | `stageInitialChanges` | boolean | No | Whether to stage initial changes instead of applying them immediately |

  #### Output [#output-7]

  | Parameter | Type | Description |
  | - | - | - |
  | `environment` | object | Created environment |
  | ↳ `id` | string | Environment ID |
  | ↳ `name` | string | Environment name |
</ReferenceDetails>

### Railway Delete Environment [#railway-delete-environment]

Delete a Railway project environment

<ReferenceDetails>
  #### Input [#input-8]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `environmentId` | string | Yes | Railway environment ID |

  #### Output [#output-8]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the environment was deleted |
</ReferenceDetails>

### Railway Create Service [#railway-create-service]

Create a Railway service from a GitHub repo or Docker image

<ReferenceDetails>
  #### Input [#input-9]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |
  | `name` | string | Yes | Service name |
  | `repo` | string | No | GitHub repository in owner/name format to deploy from |
  | `image` | string | No | Docker image to deploy, for example redis:7-alpine |
  | `branch` | string | No | Git branch to deploy when using a repository source |

  #### Output [#output-9]

  | Parameter | Type | Description |
  | - | - | - |
  | `service` | object | Created service |
  | ↳ `id` | string | Service ID |
  | ↳ `name` | string | Service name |
</ReferenceDetails>

### Railway Delete Service [#railway-delete-service]

Delete a Railway service and all of its deployments

<ReferenceDetails>
  #### Input [#input-10]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `serviceId` | string | Yes | Railway service ID |

  #### Output [#output-10]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the service was deleted |
</ReferenceDetails>

### Railway List Deployments [#railway-list-deployments]

List deployments for a Railway service in an environment

<ReferenceDetails>
  #### Input [#input-11]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |
  | `serviceId` | string | Yes | Railway service ID |
  | `environmentId` | string | Yes | Railway environment ID |
  | `first` | number | No | Maximum number of deployments to return |
  | `after` | string | No | Cursor for pagination |

  #### Output [#output-11]

  | Parameter | Type | Description |
  | - | - | - |
  | `deployments` | array | Service deployments |
  | ↳ `id` | string | Deployment ID |
  | ↳ `status` | string | Deployment status |
  | ↳ `createdAt` | string | Deployment creation timestamp |
  | ↳ `url` | string | Deployment URL |
  | ↳ `staticUrl` | string | Static deployment URL |
  | ↳ `canRollback` | boolean | Whether this deployment can be rolled back to |
  | ↳ `canRedeploy` | boolean | Whether this deployment can be redeployed |
  | `count` | number | Number of deployments returned |
  | `pageInfo` | object | Pagination information |
  | ↳ `hasNextPage` | boolean | Whether more deployments are available |
  | ↳ `endCursor` | string | Cursor for the next page |
</ReferenceDetails>

### Railway Get Deployment [#railway-get-deployment]

Get details for a single Railway deployment

<ReferenceDetails>
  #### Input [#input-12]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `deploymentId` | string | Yes | Railway deployment ID |

  #### Output [#output-12]

  | Parameter | Type | Description |
  | - | - | - |
  | `deployment` | object | Deployment details |
  | ↳ `id` | string | Deployment ID |
  | ↳ `status` | string | Deployment status |
  | ↳ `createdAt` | string | Deployment creation timestamp |
  | ↳ `url` | string | Deployment URL |
  | ↳ `staticUrl` | string | Static deployment URL |
  | ↳ `canRollback` | boolean | Whether the deployment can be rolled back to |
  | ↳ `canRedeploy` | boolean | Whether the deployment can be redeployed |
</ReferenceDetails>

### Railway Deploy Service [#railway-deploy-service]

Trigger a deployment for a Railway service in an environment

<ReferenceDetails>
  #### Input [#input-13]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `serviceId` | string | Yes | Railway service ID |
  | `environmentId` | string | Yes | Railway environment ID |
  | `commitSha` | string | No | Specific Git commit SHA to deploy |

  #### Output [#output-13]

  | Parameter | Type | Description |
  | - | - | - |
  | `deploymentId` | string | Created deployment ID |
</ReferenceDetails>

### Railway Restart Deployment [#railway-restart-deployment]

Restart a running Railway deployment without rebuilding

<ReferenceDetails>
  #### Input [#input-14]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `deploymentId` | string | Yes | Railway deployment ID |

  #### Output [#output-14]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the deployment was restarted |
</ReferenceDetails>

### Railway Rollback Deployment [#railway-rollback-deployment]

Roll a Railway service back to a previous deployment

<ReferenceDetails>
  #### Input [#input-15]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `deploymentId` | string | Yes | Railway deployment ID to roll back to (must have canRollback) |

  #### Output [#output-15]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the rollback was triggered |
</ReferenceDetails>

### Railway Get Deployment Logs [#railway-get-deployment-logs]

Retrieve runtime logs for a Railway deployment

<ReferenceDetails>
  #### Input [#input-16]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `deploymentId` | string | Yes | Railway deployment ID |
  | `limit` | number | No | Maximum number of log lines to return |

  #### Output [#output-16]

  | Parameter | Type | Description |
  | - | - | - |
  | `logs` | array | Deployment log entries |
  | ↳ `timestamp` | string | Log timestamp |
  | ↳ `message` | string | Log message |
  | ↳ `severity` | string | Log severity |
  | `count` | number | Number of log entries returned |
</ReferenceDetails>

### Railway List Variables [#railway-list-variables]

List Railway environment variables for a service or shared environment

<ReferenceDetails>
  #### Input [#input-17]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |
  | `environmentId` | string | Yes | Railway environment ID |
  | `serviceId` | string | No | Railway service ID. Omit for shared environment variables. |

  #### Output [#output-17]

  | Parameter | Type | Description |
  | - | - | - |
  | `variables` | object | Variable names and values |
  | `count` | number | Number of variables returned |
</ReferenceDetails>

### Railway Upsert Variable [#railway-upsert-variable]

Create or update a Railway environment variable

<ReferenceDetails>
  #### Input [#input-18]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |
  | `environmentId` | string | Yes | Railway environment ID |
  | `serviceId` | string | No | Railway service ID. Omit to create or update a shared variable. |
  | `name` | string | Yes | Variable name |
  | `value` | string | Yes | Variable value |
  | `skipDeploys` | boolean | No | Whether to skip automatic redeploys after changing the variable |

  #### Output [#output-18]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the variable was created or updated |
</ReferenceDetails>

### Railway Delete Variable [#railway-delete-variable]

Delete a Railway environment variable

<ReferenceDetails>
  #### Input [#input-19]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `apiKey` | string | Yes | Railway API token |
  | `tokenType` | string | No | Railway token type. Use "account" for account, workspace, or OAuth tokens, or "project" for project tokens. |
  | `projectId` | string | Yes | Railway project ID |
  | `environmentId` | string | Yes | Railway environment ID |
  | `name` | string | Yes | Variable name to delete |
  | `serviceId` | string | No | Railway service ID. Omit to delete a shared variable. |

  #### Output [#output-19]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the variable was deleted |
</ReferenceDetails>
