The default timeout in Apigee is 55seconds until your backend returns a response. If the backend takes longer than this, you may experience 504 Gateway timeout errors. Backend latency could be due to blocked processes or any other reason. Hope this is helpful.