Agroforestry systems have significant potential for development in increasing coffee production in Indonesia. Besides providing economic benefits, agroforestry can also have ecological impacts, such as improving soil structure, reducing erosion, and other environmental services. There is a complex interaction between trees, soil, and crops in agroforestry systems, making modeling a valuable approach to unraveling these processes. We utilized the spatial and temporal explicit model WaNuLCAS to (i) evaluate the model's performance in depicting actual events (through coffee production and soil water content), (ii) assess the dynamic processes influencing coffee production and the environmental impact of management patterns, (iii) formulate and simulate optimal scenarios for coffee production optimization. Data from a one-year period involving five agroforestry management patterns for coffee-pine in UB Forest were used as input for the model. The model validation results showed satisfactory and acceptable outcomes for coffee production and groundwater dynamics. WaNuLCAS simulation results indicated that pruning and thinning management are crucial factors in increasing coffee production and are related to creating optimal conditions for coffee plants (light, humidity, and inter-plant competition). Additionally, fertilization management can be combined as a supporting factor to meet the nutritional needs of coffee plants. WaNuLCAS simulation results also suggested that pruning and thinning can improve soil physical properties, but thinning increases surface runoff within the system. This research provides insights into how modeling can be used as a decision-making tool.