Error 504 Timeout

We have experienced some downtime on August 30, for domain, error 504 appeared.
We are worried that it might happen again, and we have a lot of campaigns active, that will lead users to the website
Can you please let us know, was that downtime connected with something on your side, and how can we prevent it from not happening again.
Thank you

The 502/504 errors are caused by a problem connecting to an upstream server - meaning your server is trying to initiate a process and this fails to work as expected or times out. In most cases of 502 / 504 errors, back-end servers are not communicating correctly. When this happens, you will see color page with Cloudflare branding and the Error 502 Bad Gateway or Error 504 Gateway Timeout. Review this Community Tip for fixing 502 or 504 gateway errors.