Event-driven architecture is a software architecture pattern in which the flow of the program is determined by events. An event can be generated by the user, by the system, or by another program. When an event occurs, the program responds by executing a piece of code, which is known as an event handler.