2 months ago
I regularly run into issues while attempting to manage Railway via the terraform provider due to API rate limiting. This isn't the Railway limit of 50 RPS but is instead being limited by Cloudflare as discussed in this thread: https://station.railway.com/questions/increase-api-rate-limit-325de642. This is incredibly frustrating as using terraform is critical to our operations workflow. I am sometimes able to work around it by changing my ip with a VPN but cloudflare does their job well and often quickly identifies and blocks me again. This can take days before I'm eventually unblocked.
Is there anything that can be done by Railway to make terraform usage viable? This is a critical issue for me and if I can't overcome it or at least find a reliable workaround I will probably need to migrate to another platform. Not using terraform isn't a practical option for me.
6 Replies
2 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
2 months ago
Hi there,
Could you please expand on the Cloudflare limit you're running into?
Additionally, have you considered batching requests?
Best,
The Railway Team
Status changed to Awaiting User Response Railway • about 2 months ago
sarahkb125
Hi there,Could you please expand on the Cloudflare limit you're running into?Additionally, have you considered batching requests?Best,The Railway Team
a month ago
To expand on this, I’m consistently running into Cloudflare’s Error 1015 (“You are being rate limited”), documented here:
This appears to be the same underlying problem described in this Station thread:
https://station.railway.com/questions/increase-api-rate-limit-325de642
In that thread, a Railway employee identified the issue as being related to Cloudflare’s rate limiting, and an Internal ticket was referenced regarding it. Based on my experience, it seems that issue still isn’t resolved — the same Cloudflare blocking behavior persists.
To recap: this is not the 50 RPS limit defined by the Railway API. The block occurs at Cloudflare’s edge before the API responds, returning the following error:
Error: Client Error
│
│ with module.anglo.railway_project.anglo,
│ on modules/anglo/main.tf line 140, in resource "railway_project" "anglo":
│ 140: resource "railway_project" "anglo" {
│
│ Unable to read project, got error: returned error 429 Too Many Requests: error code: 1015When this block occurs, no X-RateLimit-* headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, Retry-After) are returned — confirming that the requests are being stopped by Cloudflare before reaching the API.
HTTP/2 429
date: Thu, 23 Oct 2025 00:26:22 GMT
content-type: text/plain; charset=UTF-8
content-length: 16
retry-after: 86358
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
referrer-policy: same-origin
x-frame-options: SAMEORIGIN
server: cloudflare
cf-ray: 992d1a40bbd8197e-SOF
alt-svc: h3=":443"; ma=86400If I temporarily change my IP to bypass the block, the same requests succeed and those headers appear again, showing plenty of available capacity — well below the documented API limit.
HTTP/2 200
date: Thu, 23 Oct 2025 00:17:04 GMT
content-type: application/json; charset=utf-8
vary: Origin, Accept-Encoding
access-control-allow-origin: https://railway.com
access-control-allow-credentials: true
x-ratelimit-limit: 1000
x-ratelimit-remaining: 987.2
x-ratelimit-reset: 2025-10-23T01:05:08.700Z
cache-control: no-store
via: 1.1 google
alt-svc: h3=":443"; ma=86400
cf-cache-status: DYNAMIC
server: cloudflare
cf-ray: 992d0ca16b5ed0d7-SOFA typical Terraform run performs 36 API requests over roughly 30 seconds, which is well below the documented 50 RPS threshold. Terraform’s concurrency model also makes batching difficult without undermining its core workflow. Additionally I don't see in the graphql schema any mechanism that would support batching requests on the Railway side either.
Would it be possible to adjust the Cloudflare thresholds to align with Railway’s documented API limits?
Alternatively, if the internal ticket referenced in that thread is still active, could you share an update on its status or any current mitigation plans?
This continues to be a major operational blocker for me, as Terraform integration is essential to my workflow.
Thanks very much,
Nathan
Status changed to Awaiting Railway Response Railway • about 2 months ago
a month ago
Hello,
Without an IP address to look up, it is hard to say what limit you are running into, but it is most likely the 10 RPS limit we apply to API requests that do not have a query string.
So please try adding a query parameter to your API calls, whether that is the mutation or query name, or your Railway workspace name.
Best,
Brody
Status changed to Awaiting User Response Railway • about 2 months ago
a month ago
I can confirm that the query parameter solves the issue. I have patched and submitted a PR to the terraform provider here: https://github.com/terraform-community-providers/terraform-provider-railway/pull/55 and have it working locally. Thank you for your assistance in finding the root cause.
I would encourage Railway to consider removing that restriction or at least documenting it. The graphql API does not typically include query parameters and I could not find anywhere that it was documented that such was necessary. With a 1 day ban for hitting the 10 query per second rate limit the behavior is substantially different than described in the API docs and I don't believe it is likely consistent with your intentions.
Status changed to Awaiting Railway Response Railway • about 2 months ago
Status changed to Awaiting User Response Railway • about 2 months ago
Status changed to Solved logicwolfe • about 2 months ago