Smart factories are introducing new technologies to improve production and expand flexibility, which denotes the integration of intelligent, autonomous, and interconnected agents. The conceptual transition to dynamic multiple agents generates some dilemmas, mainly regarding the occurrence of unexpected situations. This paper aims to discuss the collective behavior of multi-agent systems in smart factories for achieving fault resilience. The proposed approach is based on three hierarchical plans: imposition, negotiation, and consensus. Fault restoration is achieved through the collective behavior that manages the ternary decisions made in these plans. The approach can help the smart factories that employ autonomous multi-agents improve their production, reliability, and robustness to failure. The proposed method was evaluated using a virtual warehouse logistics but employing real scenarios. Experiments were performed through logistic tasks to prove the collective behavior implemented in the approach for fault resilience. Quantitative analysis of the experiments shows the efficiency of the approach under various situations.