In the process of the continuous development of the Internet of Things, cloud computing has been applied in many fields, how to guarantee the quality of service, such as low latency, high bandwidth, high reliability etc., has become a challenging problem. This paper proposes a method to model and optimize reliability for microservice‐based cloud applications using multi‐agent system (MAS), thus maximizing the reliability of cloud computing and dynamically scheduling microservices to minimize the delay within the budget. Firstly, a dynamic microservice scheduling scheme is proposed to provide efficient computing services by using MAS. A hierarchical cloud computing model is formed by predicated Petri net (PrT net) and the properties of constructed model are analysed. Secondly, agents have been utilized to describe the essential characteristics of microservice scheduling process in the cloud applications. The partial critical path (PCP) aims to maximize the reliability of cloud applications under the limitation of budget and meet the user‐defined deadline. Finally, the proposed PCPRO algorithm has been applied to cloud environment, which is suitable for different scientific workflows in the cloud computing environment. The effectiveness of this method is verified by simulation, the experiment results show the effectiveness of the proposed method.