The Web of Things (WoT) attempts to overcome the Internet of Things (IoT) fragmentation and interoperability limitations by using standard web protocols. While WoT brings a huge potential for developing new and custom distributed applications, the number of system’s components and system complexity keeps growing and is ever more difficult to manage, along with an increase in resource consumption, which is a critical issue in constrained environments as the IoT. In order to tackle this issue, a framework named Self-Orchestrated Web of Things (SOrWoT) is proposed that integrates Hierarchical Finite State Machine (HFSM) constructs into WoT, allowing for the modeling of behavior in applications, breaking down complex systems, and further promoting changes in the architecting of components. A use case for applying SOrWoT’s constructs to a smart city energy management system is discussed, to showcase the framework’s practical application. Our proposed framework has the potential to improve resource efficiency, cut operational costs, and enhance overall performance by decomposing complex processes into smaller, manageable components. This modular and hierarchical strategy also has the potential to improve the system’s adaptability, resilience, and scalability.