Workflows sub-request limitation

For Workers & Pages, what is the name of the domain?

N/A

What is the error number?

N/A

What is the error message?

Too many subrequests.

What is the issue or error you’re encountering

My workflow can only make 50 sub-requests per instance

What steps have you taken to resolve the issue?

I’m testing this on an enterprise account, which should not be limited to 50 sub-requests.

Even the 1000 sub-request limit on a paid plan, seems like a major limitation for a system meant for long running tasks.

What are the steps to reproduce the issue?

import { WorkflowEntrypoint, type WorkflowEvent, type WorkflowStep } from 'cloudflare:workers';

export class TestSubrequestLimit extends WorkflowEntrypoint<Env, void> {
    async run(event: WorkflowEvent<void>, step: WorkflowStep) {
        for (let i = 0; ; i++) {
            await step.do(
                `make one subrequest ${i}`,
                async () => await (await fetch(`https://httpbin.org/anything/${i}`)).text(),
            );
        }
    }
}

My use case is to run a monthly clean-up task, that scans an s3 bucket for files that were orphaned/dangling.

Workers plans are separate from zone plans. You would need to add that to your contract, or see if you can pay for it out of contract.

Having the subrequest limit from regular workers apply to Workflows does cripple the feature a bit. I know there’s a regular Limit Increase Request form, but if you’re an enterprise customer, I recommend you reach out to the account team to see if you can get that increased, or put in as a Feature Request.

You’re right! I meant to say that we have an enterprise workers contract and we definitely are getting the paid limit for regular workers requests.

I already sent off a message to our contact, but it’s the weekend, so I thought there might be more help here.

FWIW, the workflows documentation does not mention any subrequest limit.

You’re right, but it does say that many limits come from Workers itself:

Many limits are inherited from those applied to Workers scripts and as documented in the Workers limits documentation.

So, you are getting the 1000 limit, and not just 50?

I am on a paid workers plan, but I am only getting 50 subrequests in workflows.

1 Like

In that case, it sounds like something is broken. Have you opened a Support ticket?

Hey,

Sorry for the issue, this should now be resolved if you redeploy your Worker :slight_smile:

Let me know if you continue to have issues.

1 Like

Ah, I understand now. For regular Workers, you weren’t getting that limit, but it was capped if it was a Workflow.

I just deployed again and ran that test workflow again but I’m still only getting 50.

Now I’m not sure if my account is the issue :melting_face:… Still waiting for a reply from my contact.

EDIT: Support helped me figure out the issue. My worker script was using the legacy bundled usage model which had a hard limit of 50. The field is no longer available in wrangler.toml, so I had to change it to standard in the dashboard worker settings.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.