2 days ago
Hello Railway Team,
We are developing a personal AI system that needs to operate autonomously 24/7 under Owner-controlled authorization, spending limits, and emergency stop controls.
We would appreciate your guidance on how to design and implement the following capabilities using officially supported Railway methods:
- Deploy an exact reviewed GitHub commit to a specific existing service and environment without affecting other services or their pending staged changes.
- Manage deployments through the existing ChatGPT Railway connection.
- Automatically stop a specific service after a 30-minute pilot or when a safety or spending limit is reached.
- Monitor actual usage, deployment status, and costs through our existing Control Center.
- Preserve rollback capability and prevent unintended changes to other environments.
Our existing plan is Hobby. We prefer to reuse our current infrastructure, authorization, and budget without additional credentials, permissions, or paid services.
Could you recommend the appropriate architecture, supported tools, and practical implementation steps to achieve these objectives?
If our current approach is unsuitable, please recommend a simpler, compliant alternative.
We want to achieve our goals within Railway's rules and security requirements, without bypassing any restrictions.
Thank you for your guidance.
7 Replies
2 days ago
To deploy an exact reviewed commit to one service in one environment, use the public API's serviceInstanceDeployV2 mutation with serviceId, environmentId and commitSha. The SHA is checked against the connected GitHub repo, and an unknown SHA returns "Commit not found" without creating a deployment. Details are in Manage Services with the Public API. The serviceInstance query returns that service's latestDeployment status, and you can test queries at railway.com/graphiql.
For rollback, use deploymentRollback with a previous deployment ID, or the deployment menu in the dashboard. On Hobby, rollback reaches deployments within the 72-hour image retention window. Older deployments can't be restored this way.
For spending control, set a hard limit on the Workspace Usage page or with railway usage limit set. The minimum hard limit is $10. When usage reaches it, all workloads in the workspace go offline, not just one service. Email alerts are sent at 75%, 90% and 100%. railway usage also reports workspace and project costs for a billing period. See Cost Control.
Stopping one specific service after a 30-minute pilot or a safety check isn't a built-in timer, so your own controller would need to make that call on its own schedule.
Status changed to Awaiting User Response Railway • 2 days ago
2 days ago
Thank you for your helpful response.
Could you please clarify two remaining questions?
- Does serviceInstanceDeployV2 preserve unrelated staged changes in the same environment?
- What is the officially supported way for the existing ChatGPT Railway integration to deploy and stop a specific service automatically, without creating new tokens or expanding permissions?
If the current integration cannot support this, what alternative architecture would Railway recommend within the existing Hobby plan?
We want to achieve reliable autonomous operation while fully complying with Railway's policies.
Status changed to Awaiting Railway Response Railway • 2 days ago
2 days ago
On the first question, we can't confirm how serviceInstanceDeployV2 treats unrelated staged changes in the same environment. If your workflow depends on it, check it in a separate test environment before you rely on it in production.
On the second question, the ChatGPT plugin connects through OAuth to our hosted MCP server. That OAuth connection is limited to the workspaces and projects you choose, and its tokens are short-lived. Its deployment tools are redeploy and accept-deploy. accept-deploy commits all staged changes and then deploys, so it doesn't fit a flow where other staged edits must stay pending. None of the documented hosted tools deploys a chosen commit or stops a service.
So pinning an exact reviewed commit to one service means using the public API's serviceInstanceDeployV2 with commitSha, as described earlier. That API is authenticated with an API token rather than the ChatGPT connection.
Status changed to Awaiting User Response Railway • 2 days ago
2 hours ago
Thank you for your previous guidance.
Could you clarify the following?
- Can we temporarily remove selected staged changes and restore them exactly after deploying another service?
- Is this possible through the existing ChatGPT Railway OAuth integration without creating an additional API token?
- Is there an officially supported way to deploy one service without applying unrelated staged changes?
Our goal is safe, autonomous, service-isolated deployment using existing permissions and without additional costs.
Please recommend the simplest supported approach.
Status changed to Awaiting Railway Response Railway • about 2 hours ago
2 hours ago
There isn't a control to set aside selected staged changes and bring them back later. Discard Changes in the dashboard removes the entire staged changeset for the environment, not individual edits, so anything discarded would have to be staged again by hand.
The hosted MCP server that the ChatGPT integration uses can't do this either. Its deployment tools are redeploy and accept-deploy, and accept-deploy commits all staged changes in the environment and then deploys. None of the hosted tools discards selected changes, deploys a chosen commit, or stops a service. See the MCP server tool list.
For deploying one service at a specific commit, the supported route remains the public API's serviceInstanceDeployV2 with serviceId, environmentId and commitSha, which uses an API token. We can't confirm how it treats unrelated staged changes, so the simplest way to keep those edits safe is to stage them in a separate environment from the one your automation deploys to, and to check that workflow in a test environment before relying on it.
Status changed to Awaiting User Response Railway • about 2 hours ago
Railway
There isn't a control to set aside selected staged changes and bring them back later. Discard Changes in the dashboard removes the entire staged changeset for the environment, not individual edits, so anything discarded would have to be staged again by hand. The hosted MCP server that the ChatGPT integration uses can't do this either. Its deployment tools are `redeploy` and `accept-deploy`, and `accept-deploy` commits all staged changes in the environment and then deploys. None of the hosted tools discards selected changes, deploys a chosen commit, or stops a service. See the [MCP server tool list](https://docs.railway.com/ai/mcp-server). For deploying one service at a specific commit, the supported route remains the public API's `serviceInstanceDeployV2` with `serviceId`, `environmentId` and `commitSha`, which uses an API token. We can't confirm how it treats unrelated staged changes, so the simplest way to keep those edits safe is to stage them in a separate environment from the one your automation deploys to, and to check that workflow in a test environment before relying on it.
2 hours ago
Thank you. Our issue remains unresolved.
Could a Railway engineer review this case and recommend a safe deployment workflow using our existing environment, permissions and budget, without affecting unrelated staged changes?
We would appreciate human technical assistance.
Status changed to Awaiting Railway Response Railway • about 2 hours ago
2 hours ago
We understand you'd like a person to sign off on this, but we can't provide engineering confirmation of how serviceInstanceDeployV2 interacts with unrelated staged changes. If your workflow depends on that, please check it in a separate test environment before relying on it.
The simplest setup we can recommend hasn't changed. Have your automation deploy the reviewed commit to one service with serviceInstanceDeployV2 (serviceId, environmentId and commitSha), and keep manual edits staged in a different environment from the one the automation deploys to. Deploying a chosen commit or stopping a service isn't available through the ChatGPT connection, so that step uses the public API with an API token.
Status changed to Awaiting User Response Railway • about 2 hours ago