PurposeThe current research has developed a novel method to update the decisions regarding real-time data, named the dynamic adjusted real-time decision-making (DARDEM), for updating the decisions of a grocery supply chain that avoids both frequent modifications of decisions and apathy. The DARDEM method is an integration of unsupervised machine learning and mathematical modeling. This study aims to propose a dynamic proposed a dynamic distribution structure and developed a bi-objective mixed-integer linear program to make distribution decisions along with supplier selection in the supply chain.Design/methodology/approachThe constantly changing environment of the grocery supply chains shows the necessity for dynamic distribution systems. In addition, new disruptive technologies of Industry 4.0, such as the Internet of Things, provide real-time data availability. Under such conditions, updating decisions has a crucial impact on the continued success of the supply chains. Optimization models have traditionally relied on estimated average input parameters, making it challenging to incorporate real-time data into their framework.FindingsThe proposed dynamic distribution and DARDEM method are studied in an e-grocery supply chain to minimize the total cost and complexity of the supply chain simultaneously. The proposed dynamic structure outperforms traditional distribution structures in a grocery supply chain, particularly when there is higher demand dispersion. The study showed that the DARDEM solution, the online solution, achieved an average difference of 1.54% compared to the offline solution, the optimal solution obtained in the presence of complete information. Moreover, the proposed method reduced the number of changes in downstream and upstream decisions by 30.32% and 40%, respectively, compared to the shortsighted approach.Originality/valueIntroducing a dynamic distribution structure in the supply chain that can effectively manage the challenges posed by real-time demand data, providing a balance between distribution stability and flexibility. The research develops a bi-objective mixed-integer linear program to make distribution decisions and supplier selections in the supply chain simultaneously. This model helps minimize the total cost and complexity of the e-grocery supply chain, providing valuable insights into decision-making processes. Developing a novel method to determine the status of the supply chain and online decision-making in the supply chain based on real-time data, enhancing the adaptability of the system to changing conditions. Implementing and analyzing the proposed MILP model and the developed real-time decision-making method in a case study in a grocery supply chain.