Diagnosing Cloudflare Workers Subrequest Limit Exceeded Errors
Learn how to identify when a Cloudflare Worker hits the 50‑subrequest limit, why it happens, and what steps to take to reduce or raise the limit.
04 Jun 2026, 20:33 UTC

Recognizable condition
When a Cloudflare Worker invocation returns HTTP 502 Bad Gateway and the dashboard shows an error message like "Subrequest limit exceeded" (error code 1102), the script has made more than 50 subrequests in a single execution.
Cause and diagnostic overview
| Cause | What to look for |
|---|---|
| Each fetch() (or similar subrequest) increments a counter | Search logs for "Subrequest limit exceeded" or error code 1102 |
| Loops, retries, or Promise.all that spawn many parallel fetches | Count fetch calls in the script; note any loops or arrays of URLs |
| Default limit of 50 subrequests per invocation | Verify the limit in account settings (free plan shows 50) |
Ordered checks
- Open the Cloudflare dashboard, go to Workers → your script → Logs (or Logpush) and locate the most recent 502 response. Look for the text "Subrequest limit exceeded" or error code 1102.
- Examine the Worker source code. Count every fetch() call, including those inside loops, map, filter, or Promise.all. A quick way is to temporarily add a console.log before each fetch and redeploy to a test route, then check the log count.
- If you see the count exceeds 50, note the pattern (e.g., iterating over an array of 60 URLs).
- Confirm that reducing the number of fetch calls (e.g., to 45) eliminates the error by deploying a test version and checking the response.
Fixes tied to findings
- Batching requests: If you are fetching many independent resources, combine them into a single request to an aggregation endpoint or use Workers KV/Durable Objects to store data beforehand.
- Reduce parallelism: Replace Promise.all([...]) with a sequential loop or limit concurrency (e.g., process 5 URLs at a time) to stay under the limit.
- Cache results: Store frequently accessed data in Workers KV with a short TTL and read from KV instead of making fresh fetch calls.
- Upgrade plan: On a Workers Bundled or Enterprise plan, the subrequest limit can be increased (e.g., to 200). Check Account → Workers → Limits to see the current quota.
Escalation criteria
If after applying the above fixes the Worker still needs to make more than the allowed subrequests (for example, a legitimate workflow that must call 120 distinct APIs), then:
- Open a support ticket through the Cloudflare dashboard, specifying the Worker name, the required subrequest count, and the plan you are on.
- Ask whether a higher‑tier plan or a custom limit increase is available for your use case.
- Consider migrating the workload to Cloudflare Pages Functions, which currently offers a higher subrequest quota, or to a traditional server‑less environment outside Workers.
Note: The subrequest limit is per invocation; resetting the limit between retries does not reset the counter, so recursive retry patterns can still hit the limit.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.