Every day and with more frequency, the term industry 4.0 is heard, referring to the world is experiencing the fourth industrial revolution. Focusing on the concept of industry 4.0 speaks of a new way of understanding production systems and interconnecting them seeking automation, a priori, one might think that this change of automated machines to replace mechanical or manual tasks began more than 30 years ago. The meaning of this new revolution goes beyond automation; it is a digital integration or transformation. Industry 4.0 implements intelligent assistants who make optimal plan decisions while complying with restrictions and capacities. Real-time and virtual control tools provide information in seconds and improve the efficiency, responsiveness, and self-management of processes by integrating them collaboratively in favor of the human. Under this reality, the purpose of this article is addressed, developed in a crucial Ecuadorian company in the food sector, where a great opportunity has been identified to improve the current way in which the weekly production schedule of the pasta drying line is carried out. Automation and optimal planning are proposed as alternative solutions through the design and application of a mixed-integer linear programming mathematical model. Currently, the company carries out the planning of its weekly production manually, which causes inefficiency in the timely satisfaction of demand and cost overruns due to reprocessing and overstock of unrequested SKUs.Through the development of this tool, it is sought to optimize the correct use of the company's resources, minimizing the operating costs of production, considering the production capacity, the optimal sequence of tasks, and their restrictions to carry out the modeling.