The function as a service (FaaS) model, in which the costs are linked to the function time of use, is especially suitable in IoT or similar systems, where the information is collected periodically to consume less energy. A FaaS approach also allows us to fine-tune the application’s behaviour at a function level, controlling which functions should be executed at any given time. This makes it possible to apply optimisation processes in an automated way. In this work, a FaaS-based platform is proposed to develop e-Health applications that adapt their behaviour to the different stages of the patient rehabilitation process. Its operation is illustrated by a case study on patients with heart disease. The system’s operation will vary throughout the different stages of the rehabilitation, adjusting to the available sensors, the evolution of the patient’s physical condition and other parameters such as the required precision.