Skip to content

feat: Add Railway integration#5083

Draft
12458 wants to merge 8 commits into
superplanehq:mainfrom
12458:feat/railway-integration
Draft

feat: Add Railway integration#5083
12458 wants to merge 8 commits into
superplanehq:mainfrom
12458:feat/railway-integration

Conversation

@12458

@12458 12458 commented May 30, 2026

Copy link
Copy Markdown

This PR implements the base Railway integration (#2910) using the new wizard-based setup flow.

What changed

Backend (pkg/integrations/railway/)

  • GraphQL Client (client.go): Wrapped the Railway GraphQL API (v2 backboard), adding methods for Verify, ListWorkspaces, ListProjects, GetProjectDetails, TriggerDeploy (redeployment), GetDeployment (polling check), and rule management.
  • Setup Wizard (setup_provider.go): Multi-step wizard allowing capability selection, Workspace Token input, validation, and secure secrets storage.
  • Webhook Provisioning (webhook_handler.go): Dynamically loads project details to extract the correct workspace ID, and automatically creates the platform notification rule on Railway (notificationRuleCreate).
  • On Deployment Trigger (on_deployment.go): Subscribes to and parses Railway platform notifications (including nested resource payloads) to emit status updates.
  • Trigger Deploy Action (trigger_deploy.go): Triggers service redeployment and runs a polling loop checker. Emits to the success or failed channel depending on terminal states.
  • Blank Import (pkg/registryimports/registryimports.go): Registered the railway integration package.

Frontend

  • Branding Assets (railway.svg): Added the official Railway branding logo.
  • Icon Registry (integrationIconMaps.ts): Mapped "railway" to the SVG logo.
  • Canvas Mappers (web_src/src/pages/workflowv2/mappers/railway/): Added mappers (base.ts, on_deployment.ts, trigger_deploy.ts, index.ts) for custom styling, labels, configuration details, execution outcomes, and timelines.
  • Mappers Registry (web_src/src/pages/workflowv2/mappers/index.ts): Integrated the mappers into the main workflow v2 canvas list.

Documentation (docs/components/Railway.mdx)

  • Generated component documentation automatically via make gen.components.docs.

Why

To enable SuperPlane workflows to redeploy services and respond to deployment state changes on the Railway platform.

How

  • The Graphql Backboard API is queried with Workspace API Tokens.
  • Platform notification rule configurations (Deployment.* statuses) are mapped to standard unguessable UUID webhook paths.
  • Execution polling hook executes every 15 seconds while state is active, and terminates on SUCCESS or failure/cancellation statuses (FAILED, CRASHED, REMOVED, SKIPPED, SLEEPING).

Verification

  • Backend tests: Passed all 49 unit tests in pkg/integrations/railway.
  • Gofmt / Lints / App build: Passed revive, go build cmd/server, and gofmt.
  • Frontend checks: Passed eslint, check.build.ui (production compile), and prettier format check.

12458 added 6 commits May 30, 2026 13:39
Signed-off-by: Shang En Sim <6071014+12458@users.noreply.github.com>
Signed-off-by: Shang En Sim <6071014+12458@users.noreply.github.com>
Signed-off-by: Shang En Sim <6071014+12458@users.noreply.github.com>
Signed-off-by: Shang En Sim <6071014+12458@users.noreply.github.com>
Signed-off-by: Shang En Sim <6071014+12458@users.noreply.github.com>
Signed-off-by: Shang En Sim <6071014+12458@users.noreply.github.com>
@superplanehq-integration

Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

@12458 12458 changed the title Railway Integration feat: Add Railway integration May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant