Wireless sensor networks (WSN) have become the eyes and arms of business processes, far beyond production line automation, and have moved into the fabric of everyday life. Business processes describe the steps and interactions required to achieve a desired economic goal. Sensor networks are pervasively included in such processes from an early design phase using graphical models. However, automatically translating graphical descriptions to WSN platforms is a challenge. Graphical descriptions are typically based on a parallel execution model, whereas the norm for WSN is an event-based execution model on resource constrained platforms. We show how the synchronization primitives from a graphical business process modeling language can be mapped directly to efficient event-based code. Moreover, we explore platform-specific optimizations which enable the generated code to compete with hand-coded equivalents in terms of resource usage. For commercially attractive solutions we focus on reducing both the energy consumption as well as memory usage which directly impact the maintenance cost of a WSN. © 2012 IEEE.