You would need another workaround for long running scripts such as…
Reduce the tasks or optimise the script so it completes faster, or break it up into separate requests
Don’t use the Cloudflare proxy and have a dedicated subdomain that is set to “DNS only” for long-running scripts, controlling the timeout at your server
Change the implementation so that loading the page starts the process and have the client poll at intervals for completion