Alright, I understand. It is unlikely Cloudflare will randomly increase that but maybe you have longer timeouts on paid plans. I’d contact support for that at their “support@” address.
Alternatively, I’d approach it asynchronously. You kick off that document generation with a quick request, which issues a sort of “ticket” number. Then you generate the document for that “ticket” in the background asynchronously and have the client regularly check back for that ticket. Once the document is ready you simply return it in your response to the check.
Alternatively alternatively, you can also follow Cloudflare’s advice for these situations and move that to a host that is not behind Cloudflare.
If you regularly run HTTP requests that take over 100 seconds to complete (for example large data exports), consider moving those long-running processes to a subdomain that is not proxied by Cloudflare. That subdomain would have the orange cloud icon toggled to grey in the Cloudflare DNS Settings . Note that you cannot use a Page Rule to circumvent Error 524.
Of course you’d lose whatever you gain by tunnelling it through Cloudflare.