The health service industry is required to improve its performance and service to the society continuously. Improvements in performance and service can be done by improving health workers' performance, one example of which is improving the performance of medical trainees. Medical trainees are required to be able to serve patients well, timely and on target for 24 hours, hence scheduling is needed. Medical trainees scheduling in this case is to allocate 179 medical trainees divided into 26 groups, followed by scheduling it into 16 units/clinics/hospital departments for 2 years (96 weeks). Each hospital department has criteria for mental workload, physical workload, fatigue level, group capacity and different duration of time. Therefore, there is a need for scheduling that takes the whole thing into account. Scheduling in this case is still conducted by plotting medical trainees manually and has not considered ergonomic factors (the physical workload, mental workload and fatigue level) at each hospital department. Medical trainees scheduling considering ergonomic factors can be adopted to reduce ergonomic risks and achieve better performance of medical trainees. In this paper, the authors propose an integer nonlinear programming which aims to find optimal scheduling to minimize the deviation in mental workload, physical workload and fatigue level that ware experienced by medical trainees in every month. The mental workload, physical workload and fatigue level were evaluated using the NASA TLX method, pulse rate recall questionnaire and Subjective Self Rating Test (SSRT). Optimal scheduling is needed to reduce the fatigue felt by medical trainees during 96 weeks of clinical clerkship. The results revealed the effectiveness of the model because the scheduling in each department was proven to be done in according to the capacity and time vulnerability based on the regulations and could create a balance of physical workload, mental workload and fatigue level of medical trainees on a monthly basis.