Internet of Things is advancing, and the augmented role of architecture in automating processes is at its vanguard. Mission-critical applications are becoming a vital category of future IoT applications, and due to the advancements in the 5G, the design of mission-critical application overcome a big hurdle. Missioncritical applications must be reliable, and the output should be known in advance. Therefore, to model such application, architecture is considered the cornerstone. One of the major requirements is the flexibility of the operation and the adaptability to new devices. In this paper, an optimal orchestration mechanism is proposed to automate the processes in a conventional multi-device and multi-task mission-critical architecture for flexible and scalable operations. The central goal of this paper is to threefold; first, to model tasks in such a way to maximize the flexibility in the operation plane. Secondly, to design a strongly correlated pair which has maximum relation and thus the chance to hit the task on the devices will be potentially maximized and also the idle time among operations is minimal. Lastly, to register devices in a network which is optimal for the group of this device in terms of correlation. We propose a multi-layer particle swarm optimization for each of the optimization objectives. Results show that the operation plan is flexible and with scaling up the problem size, the orchestration is still graceful and within the requirements of mission-critical applications. The performance of multi-level particle swarm optimization is compared with conventional single-level particle swarm optimization and it has been learned that the later is not only slower but also less accurate.INDEX TERMS Internet of Things, task modeling, mission-critical IoT systems, task mapping, task deployment, service orchestration, task orchestration.