Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
83e49a2
feat: Add Railway Integration
shambel-amare Feb 10, 2026
f048656
Merge branch 'main' of github.com:shambel-amare/superplane into feat/…
shambel-amare Feb 10, 2026
97fe0cb
fix: implemented missing method
shambel-amare Feb 11, 2026
6ff3562
fix: check for empty event action
shambel-amare Feb 11, 2026
0988b3e
fix: use example json files similar to other integrations
shambel-amare Feb 11, 2026
529e8b9
fix: read status from correct path
shambel-amare Feb 11, 2026
32136a5
fix: add prettier syntax
shambel-amare Feb 11, 2026
5a175e0
fix: generate latest doc
shambel-amare Feb 11, 2026
54b2743
fix: validate project-id from incomming webhook payload before proces…
shambel-amare Feb 11, 2026
b8ceb85
fix: remove unused method
shambel-amare Feb 11, 2026
77fdeb3
fix: non-workspace railway tokens have no access to projects
shambel-amare Feb 11, 2026
9d46877
fix: use correct railway webhook event keys
shambel-amare Feb 11, 2026
91a7f72
fix: generate docs
shambel-amare Feb 11, 2026
03fd720
fix: update deployment event options to include 'Failed' and reorder …
shambel-amare Feb 11, 2026
1202da3
fix: use correct event type on curl
shambel-amare Feb 12, 2026
6b59c90
chore: simplified instruction
shambel-amare Feb 12, 2026
b65d04c
feat: Add polling based status tracking for deployment trigger
shambel-amare Feb 12, 2026
ab0fef5
fix: use correct event name
shambel-amare Feb 12, 2026
ec68015
fix: fix prettier formating
shambel-amare Feb 12, 2026
dcda7f8
fix: fix wrong webhook handler setup
shambel-amare Feb 12, 2026
bd5c0dc
fix: add omitted from final status check
shambel-amare Feb 12, 2026
4ed1310
Merge branch 'main' of github.com:shambel-amare/superplane into feat/…
shambel-amare Feb 12, 2026
752e78c
chore: removed unused test
shambel-amare Feb 12, 2026
6db7195
chore: match example data to code
shambel-amare Feb 12, 2026
f8f8feb
chore: generate components doc
shambel-amare Feb 12, 2026
82ff5a3
fix: fix prettier formating
shambel-amare Feb 12, 2026
9940fa0
fix: fix prettier formating
shambel-amare Feb 12, 2026
710561e
chore: increase polling interval
shambel-amare Feb 12, 2026
8501c5c
chore: format with prettier
shambel-amare Feb 12, 2026
0e7cfe9
Merge branch 'main' of github.com:shambel-amare/superplane into feat/…
shambel-amare Feb 12, 2026
e230307
fix: added missing mapper for railway trigger
shambel-amare Feb 18, 2026
bde78de
Merge branch 'main' of github.com:shambel-amare/superplane into feat/…
shambel-amare Feb 18, 2026
fc6c9e8
fix: add missed evens on trigger block
shambel-amare Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
176 changes: 176 additions & 0 deletions docs/components/Railway.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
---
title: "Railway"
---

Deploy and monitor Railway applications

## Triggers

<CardGrid>
<LinkCard title="On Deployment Event" href="#on-deployment-event" description="Trigger when a Railway deployment status changes" />
</CardGrid>

import { CardGrid, LinkCard } from "@astrojs/starlight/components";

## Actions

<CardGrid>
<LinkCard title="Trigger Deploy" href="#trigger-deploy" description="Trigger a new deployment for a Railway service" />
</CardGrid>

## Instructions

## Connect Railway

### Creating an API Token

1. Go to [Railway Account Settings → Tokens](https://railway.app/account/tokens)
2. Click **"Create Token"** to generate a new API token
3. Give your token a descriptive name (e.g., "SuperPlane Integration")

### Token Scoping

Railway offers different token scoping options:

| Scope | Access Level | Use Case |
|-------|--------------|----------|
| **No Workspace** | All workspaces and projects | Recommended for SuperPlane |
| **Team/Workspace** | Projects in a specific workspace only | Limited to one workspace |

**Recommendation:** Select **"No Workspace"** when creating your token. This allows SuperPlane to access all your projects across workspaces. If you scope the token to a specific workspace, only projects in that workspace will be available.

### Permissions

The API token allows SuperPlane to:
- List your projects, services, and environments
- Trigger deployments on your services
- Receive deployment status webhooks

### Webhook Configuration

For the **On Deployment Event** trigger, you'll need to manually configure webhooks in Railway:

1. Create the trigger in SuperPlane and save the canvas
2. Copy the generated webhook URL from the trigger settings
3. Go to your Railway project → Settings → Webhooks
4. Add the webhook URL and select "Deploy" events

### Troubleshooting

- **"Not Authorized" error**: Your token may be scoped to a workspace that doesn't include the project you're trying to access. Create a new token with "No Scoping" selected.
- **Projects not showing**: Try disconnecting and reconnecting the integration to refresh the project list.

<a id="on-deployment-event"></a>

## On Deployment Event

The On Deployment Event trigger starts a workflow when Railway sends deployment status webhooks.

### Setup

After configuring this trigger:
1. Copy the webhook URL shown in the trigger settings
2. Go to Railway → Your Project → Settings → Webhooks
3. Add the webhook URL and select "Deploy" events
4. Save the webhook configuration

### Use Cases

- **Deployment notifications**: Notify Slack when deployments succeed or fail
- **Incident creation**: Create tickets when deployments crash
- **Pipeline chaining**: Trigger downstream workflows after successful deployments

### Configuration

- **Project**: Select the Railway project to monitor
- **Event Filter**: Optionally filter by deployment event type (succeeded, failed, crashed, etc.)
- Leave empty to receive all deployment events

### Event Data

Each deployment event includes:
- `type`: Event type (e.g., Deployment.succeeded, Deployment.failed)
- `details.status`: Deployment status
- `resource.deployment.id`: Deployment ID
- `resource.service`: Service name and ID
- `resource.environment`: Environment name and ID
- `resource.project`: Project information
- `timestamp`: When the event occurred

### Example Data

```json
{
"details": {
"status": "SUCCESS"
},
"resource": {
"deployment": {
"id": "deploy-jkl345"
},
"environment": {
"id": "env-def456",
"name": "production"
},
"owner": {
"email": "user@example.com",
"id": "owner-abc123"
},
"project": {
"id": "proj-xyz789",
"name": "my-project"
},
"service": {
"id": "srv-ghi012",
"name": "api-server"
}
},
"timestamp": "2024-01-15T10:30:00.000Z",
"type": "Deployment.succeeded"
}
```

<a id="trigger-deploy"></a>

## Trigger Deploy

The Trigger Deploy component starts a new deployment for a Railway service in a specific environment.

### Use Cases

- **Deploy on merge**: Automatically deploy when code is merged to main
- **Scheduled deployments**: Deploy on a schedule (e.g., nightly releases)
- **Manual approval**: Deploy after approval in the workflow
- **Cross-service orchestration**: Deploy services in sequence

### Configuration

- **Project**: Select the Railway project
- **Service**: Select the service to deploy
- **Environment**: Select the target environment (e.g., production, staging)

### How It Works

1. Calls Railway's `environmentTriggersDeploy` API
2. Railway queues a new deployment for the service
3. Component emits the deployment trigger result

### Output

The component emits:
- `project`: Project ID
- `service`: Service ID
- `environment`: Environment ID
- `triggered`: Whether the deployment was triggered

### Example Output

```json
{
"environment": "env-def456",
"project": "proj-xyz789",
"service": "srv-ghi012",
"triggered": true
}
```

Loading