Definition of complex event processing
A door opening is an event. A door left open while the temperature rises is a situation, which no single event signals on its own. Complex event processing (CEP) refers, in common usage, to the detection of such situations: a program reads a stream of events and looks in it for patterns described in advance.
This usage can be seen in the documentation of two tools, consulted on 12 November 2026. The Apache Flink documentation (version 2.3) presents the FlinkCEP library as the means of detecting event patterns in an endless stream. The Esper project, published under the GPLv2 licence, describes itself as a language, a compiler and a runtime for CEP and stream analytics. Its FAQ sheds light on the adjective: “complex” refers to the formation of composite events, through the detection of relationships between events, and not to complicated processing.
A pattern on the doors and temperatures of a warehouse
Take a cold storage warehouse in which each chamber publishes three types of events: door opened, door closed, temperature reading. The pattern sought: a door opening, with no closing, then two readings above the threshold, all within a set time. When the stream contains it, the program emits a “chamber drifting” event.
These events come from sensors and controllers, whose connection to the information system falls, in common usage, under IT/OT convergence. The Esper website cites, among the applications of CEP, fraud detection, network monitoring and sensor networks.
Condition, repetition, contiguity, absence, time window
The FlinkCEP documentation lists the building blocks of a pattern:
- a condition on each expected event;
- a quantifier: once, several times, a given number of times, or optionally;
- a contiguity: strict (no foreign event comes in between), relaxed (events foreign to the pattern are ignored) or non-deterministic relaxed;
- a negation: a given event must not follow, or must not come in between;
- a time constraint, which limits the time within which the pattern occurs.
FlinkCEP expresses these patterns through a programming interface. Esper writes them in a declarative language, EPL, which it presents as an extension of SQL.
Memory, event order, patterns to be written: the limits
Detection requires memory: according to the Esper FAQ, CEP keeps state, for example partially matched patterns. The Flink documentation advises bounding a repeating pattern with a stop condition or a time window, so that this state can be purged.
Order also matters. In event time, FlinkCEP sorts events by their timestamp and does not process those it considers late; a side output makes it possible to collect them. A sensor that transmits late can therefore cause a pattern to be missed.
Finally, the program recognises only the patterns that have been written: a situation that no one has described goes by without an alert.
Complex event processing, stream processing, rule engine: not to be confused
The Esper FAQ associates event stream processing with filtering, joins and aggregation, and CEP with causality between events; it says it combines the two in the Esper language. FlinkCEP is a library built on top of a stream processing engine.
According to the same FAQ, rule engines and decision tools have the analysis of facts as their strength; the latter generally work on demand. It entrusts CEP with detecting the situation, continuously; and these tools, sometimes, with choosing what to do next.
AIOps applies machine learning to operational data, whereas a CEP pattern is written in advance by a person.
Event-driven architecture describes the way applications exchange events; CEP is a form of processing, which can read these exchanges.
Before looking for patterns, the events must flow: the modes of exchange between applications, events included, are compared on our IT architecture page.