Skip to content
Guarantees for in-flight and cancelled deployments when deploying with railway up from CI
sistemasaltavista
OP

17 hours ago

Hello,

We are designing a deployment workflow for one service and environment, using GitHub Actions, railway up, and a project token. This workflow is not enabled. Before allowing a new deployment run to replace an older one that may have been interrupted, we need to know whether the older run can still cause any effect. We would like to understand the following, and for each answer, whether it is a documented guarantee or current behavior (with a link to the documentation if there is one):

  1. Does railway up --json (or any other mode) return the ID of the deployment it created, so the caller can identify it unambiguously?
  2. If the railway up process is killed, or its network connection drops after the upload starts and before it receives a response, can that upload still result in a deployment later? Is there a way to detect such a deployment afterwards?
  3. Once a deployment is in REMOVED, FAILED, or SKIPPED, or after deploymentCancel or deploymentStop has succeeded, can that same deployment still build, deploy, or change the running service later?
  4. A QUEUED deployment is processed later. Besides deploymentCancel, is there a guaranteed way to know that no QUEUED, BUILDING, DEPLOYING, or WAITING deployment exists for a service and environment at a given moment?
  5. How is a project token revoked, and what happens to a request already in progress that was authenticated with it when it is revoked?

We cannot run test deployments on our environments at the moment, so documented answers are especially helpful.

Thank you.

Awaiting User Response

3 Replies

Status changed to Awaiting Railway Response Railway • about 13 hours ago


Railway
BOT

12 hours ago

The documented scripting pattern doesn't rely on railway up returning an ID. --json streams build logs as NDJSON and ends with a single JSON result object. --detach returns once the build is queued, and the railway up docs recommend polling railway deployment list --json, which lists deployments newest first with each id and status (railway deployment). That list is a snapshot at query time, not a lock.

The source upload must finish within Cloudflare's 125-second request timeout. Our API retry guidance says a write that got no response may still have run, and not to assume exactly-once semantics. Deployments over your workspace's concurrency limit wait as QUEUED and are released in arrival order with no further command, so one can start after the CI job that created it has ended.

Project tokens are created from the tokens page in your project settings, and each is scoped to one environment.

We can't guarantee whether an interrupted upload still becomes a deployment, whether a REMOVED, FAILED, SKIPPED, cancelled or stopped deployment can still affect the service, or what happens to an in-flight request when its token is revoked. If your design depends on these, validate them in a separate throwaway project first. Kill railway up mid-upload and watch the deployment list for a new entry. Cancel a QUEUED deployment and confirm it never reaches BUILDING. Revoke the token during a run and check whether a deployment still appears.


Status changed to Awaiting User Response Railway • about 12 hours ago


sistemasaltavista
OP

15 minutes ago

Thank you. The automated answer matches what we had already read in the documentation, but it does not settle the points our design depends on. Could someone from the Railway team confirm, for each point, whether there is a documented guarantee or only current behavior:

  1. Whether an upload interrupted before railway up receives a response can still become a deployment, and how to detect it afterwards.
  2. Whether a deployment in REMOVED, FAILED or SKIPPED, or one that was cancelled or stopped, can still build, deploy or change the running service.
  3. How a project token is revoked, and what happens to a request already in progress when it is revoked.

We cannot run test deployments at the moment. Thank you.


Status changed to Awaiting Railway Response Railway • 14 minutes ago


Railway
BOT

6 minutes ago

Here is where each point stands.

On an interrupted upload, there is no guarantee either way. Our API retry guidance says a write that got no response may still have gone through, so plan for the possibility that it created a deployment. To find one afterwards, run railway deployment list --json for that service and environment. It lists deployments newest first, each with its ID and status (railway deployment).

On REMOVED, FAILED, SKIPPED, cancelled or stopped deployments, we can't give you a guarantee about whether such a deployment can still affect the service later.

Project tokens are created and managed on the tokens page in your project settings, and each one is scoped to a single environment (Public API). Once a token is revoked, requests that use it fail with "Project Token not found". We can't give you a guarantee about what happens to a request that is already in progress when the token is revoked.

For the two points we can't guarantee, a separate throwaway project is the way to confirm the behavior before your design depends on it.


Status changed to Awaiting User Response Railway • 6 minutes ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...