The Internet of Things is an emerging technology, driven by combining the physical world with the cyberspace. The IoT enables new approaches such as, smart homes, smart factories and smart cities. An ability of such IoT environments is to immediately react to changing conditions, i.e., situations. Situation recognition can be implemented, for example, by defining and executing data flow models. The state of the art for the execution of data flow models is to utilize an execution engine, typically running in the cloud. Data is transmitted from devices to the engine to be processed. This solution has many disadvantages, like, for example, communication overhead, a single point of failure and long distances for data transfer. Since IoT devices are equipped with processing power themselves, data does not necessarily have to be sent to the cloud, but can be processed on the devices themselves. It can be transmitted directly between devices and does not have to travel the long detour to the cloud and back to the IoT environment. Consequently, a better solution is to execute the data flow model directly on the IoT devices, without using a centralized execution engine. To execute data flow models in distributed IoT environments, in this Master thesis, I propose a lifecycle method with five steps: (i) the modeling of the data flow, (ii) the creation or modification of the network topology, (iii) the execution of the data flow model, (iv) the device redistribution and (v) the retirement of the data flow. As a proof-of-concept and for evaluation purposes, a prototype has been implemented.