A system and method for configuring a state diagram with graphical source code is described. The state diagram may be created in response to user input. The state diagram may include a plurality of state icons and a plurality of connector elements interconnecting the state icons, where the state icons represent a plurality of states and wherein the connector elements represent transitions between the states. Graphical source code may be associated with one or more of the state icons.