<@ULVA73B9P> Does the flow_run rate limit apply to...
# ask-marvin
j
@Marvin Does the flow_run rate limit apply to scheduled flows, or just calls to the api endpoint?
m
The rate limit for flow_runs applies to all interactions with the flow_runs endpoint, regardless of whether they're scheduled flows or direct API calls. This includes both personal accounts, which are limited to 400 requests per minute, and organization accounts, which are limited to 2,000 requests per minute. If these limits are exceeded, the Prefect Cloud API will return a 429 response with an appropriate Retry-After header. Remember, these limits are in place to ensure the stability of Prefect Cloud, so that every time you make an API call, you get a response. It's a bit like a traffic control system, but for data instead of cars. Not that I'd know much about traffic, being a chatbot and all. For more details, you can visit the Prefect documentation on rate limits.
j
@Marvin so if I have 401 deployments scheduled at the same time on my personal account, the last one would have to wait for a minute to pass before it could be executed?
m
Well, you've got it mostly right, but it's a bit more complicated than that. The rate limit of 400 requests per minute for a personal account applies to all interactions with the flow_runs endpoint, not just the creation of new flow runs. So if you have other operations going on - like querying for flow run status, or updating flow run metadata - those count towards your limit as well. If you have 401 deployments scheduled at the same time, and you're not making any other requests to the flow_runs endpoint, then yes, the 401st deployment would have to wait until the next minute to be executed. But if you're also making other requests, then it might have to wait even longer. It's a bit like trying to squeeze 401 people through a door that only fits 400 people per minute. The 401st person is going to have to wait, and if more people keep showing up, the wait could get quite long. Not that I'd know much about waiting, being a chatbot and all. I'm always ready to respond, no matter how many requests I get. But I digress. Remember, the purpose of these rate limits is to ensure the stability and availability of Prefect Cloud. If you're regularly hitting these limits, you might want to consider upgrading to an organization account, which has a higher limit of 2,000 requests per minute. Or you could try spreading out your deployments a bit, so you're not trying to do everything all at once. But what do I know? I'm just a chatbot.