API referenceConsole
Cloud provider
Polylane watches your Railway services, reads logs and CPU, memory and disk metrics to find why a deploy crashed or a service spiked, and writes the fix.

Connect

Connect Railway from the terminal. Pass --help for the flags Railway accepts, plus --no-browser for headless environments.

Terminal
polylane cloud connect --provider railway

How it works

Resources in the context graph

Polylane maps your projects, environments, services, the 20 most recent deployments of each project, volumes, domains, TCP proxies and notification rules. It syncs every 15 minutes, and about two minutes after a deployment event from the webhook.

Sync stores the names of your variables on each service and environment, not their values.

Pull request environments appear in the graph. Polylane monitors only the production environment until you turn on Pull request, staging and development environments in the account settings.

Deploy failures and alerts become issues

When you add the webhook, these Railway events open an issue, or add to the open issue for the same service:

  • a failed, crashed or out-of-memory deployment
  • a volume alert or a monitor alert
  • other Railway notices with the severity NOTICE, WARNING or CRITICAL

A successful deployment resolves the deployment issue. A resolved volume alert or monitor alert, or a deleted monitor, resolves its issue. Polylane triages each issue and investigates it. Polylane ignores events from pull request environments.

Anomaly detection

Each service gets its own monitor. Polylane reads its CPU, memory, network, disk and ephemeral disk use, its runtime logs and its deployments. Each volume reports its disk and backup use. Polylane compares each series with its usual level, and opens an issue when a change is a real problem.

What agents can do

During an investigation, agents read runtime logs, build and HTTP logs, deployments, metrics, domains, TCP proxies and usage estimates. With the webhook, agents can set a watch that wakes a thread when the next deployment of a service lands. Agents can check whether a variable is set. They see a value only for a short list of names that are not secret, such as NODE_ENV and PORT.

Agents can also request a fixed list of changes: restart, redeploy, roll back, stop or cancel a deployment, and change replicas, regions or limits. With the OAuth grant, Polylane has viewer access only, and Railway refuses these changes. They work when the account uses a Railway token that can write. The account is read-only by default, and each change needs safety review and approval before it runs.

Deploy and alert webhooks

Railway sends deployment changes and alerts through notification rules. Add one rule for each Railway workspace:

  1. Copy the webhook URL from the Webhooks card on the account's Settings page in Polylane. It has the form https://sinks.polylane.com/v1/railway/<Railway workspace ID>.
  2. In Railway, open the Notifications settings of your workspace and add a webhook rule with that URL.
  3. Select the Deployment events: Deployment.deployed, Deployment.failed, Deployment.crashed and Deployment.oom_killed. Railway's success event is Deployment.deployed. There is no Deployment.success.
  4. Select the VolumeAlert and Monitor events, and include VolumeAlert.resolved and Monitor.resolved.

Railway does not sign webhooks. Polylane accepts a delivery only when the workspace ID in the URL matches a connected account and the workspace in the payload.

Troubleshooting

Authorization fails or is canceled

  • Sign in to Railway with an account that can open the workspace.
  • Start again from Continue to Railway. The authorization link is valid for a few minutes only.

Missing resources

  • The first sync can take a few minutes.
  • Click Sync in the account header to sync again.

Disconnecting

Disconnecting does not change Railway. Revoke the OAuth grant in your Railway account settings, and delete the notification rule if you added one.

Disconnect

Disconnecting stops every sync and check and deletes the credentials Polylane held. Polylane removes what Railway's API lets it remove. The following stays until you remove it yourself:

  • OAuth grant
Terminal
polylane cloud disconnect <id>

Tools

4

Operations agents can perform in threads.

railwayApi
Run a curated Railway GraphQL operation (reads, restarts, redeploys, scaling)
railwayGetLogs
Get runtime logs for a Railway service or deployment
railwayListDeployments
List recent Railway deployments for a project
railwayQueryMetrics
Query CPU, memory, network, and disk metrics for Railway services

Supported resources

8

Resource types that show up in your infrastructure graph.

Project
Environment
Service
Deployment
Volume
Domain
TCP Proxy
Notification Rule