Edge computing brings data processing, analytics and storage closer to the source, but the major limitation of edge devices is that they have limited processing power and storage. Some have argued that cloud can be a solution to overcome the edge computing limitations. However, performing all tasks on the cloud introduces latency issues. Therefore, we need a solution that can use edge and cloud computing intelligently and interchangeable such that the merits of both can be utilized based on the specific scenario. Such a model has not been discussed in the literature so far which poses a very important limitation. We proposed a novel architecture that intelligently switches data processing between the cloud and edge just-in-time based on specific conditions i.e., if a healthcare scenario demands low latency data is processed at the edge otherwise data is automatically processed on the cloud. We illustrate this by creating an Automatic edge application to monitor high risk cardiovascular disease patients who are at the risk of heart attacks after a post-operative surgery. Low latency is very important while monitoring such patients and the application is built to automatically detect all such cases and performs heart attack predictions on the edge while other patients data is processing on the cloud. The experimental results have demonstrated that our application can automatically detect high risk cardiovascular disease patients and place their workloads on the edge which is a new and unique invention in the area of automated edge computing. We have also demonstrated that the data retrieval from the edge is 55% faster than the cloud thereby ensuring low latency with edge.