On n8n Cloud, long-running jobs (over 1-2 minutes) are likely to fail due to platform timeouts. The best practice is to use an asynchronous pattern: trigger the job, return immediately, and poll for completion.
If your workflow does not respond within this time, the request will fail with a 524 error.
Or…
If you need to process very large jobs synchronously, consider self-hosting n8n, where you can control and increase the execution and request timeouts.