According to the scenario, the capacity planning flow fails when the gateway is offline. To avoid this issue, you can create a gateway cluster that consists of two or more gateways that share the same configuration and data sources. This way, if one gateway is offline, another gateway in the cluster can handle the requests and ensure high availability for your flow.