The insect that uses species-specific bioluminescent flash patterns to attract mates is the firefly.
Fireflies are beetles in the family Lampyridae, not true flies. In many species, flying males produce patterned flashes while searching for females, and females answer with a timed response. The signals can differ in duration, color, timing, repetition rate, flight height, and direction, helping individuals recognize members of their own species.
The light comes from a chemical reaction involving luciferin, luciferase, oxygen, and cellular energy. Bioluminescence probably first evolved in firefly larvae as a warning that they were distasteful, then became useful as a courtship signal in adults. Some tropical fireflies even synchronize their flashes in large groups.
Glowworm is a common source of confusion because the name can refer to luminous larvae, females, or unrelated insects in different regions. Click beetles also include bioluminescent species, but the familiar species-specific courtship flash patterns described in the question are characteristic of fireflies. A remarkable exception occurs when female Photuris fireflies imitate Photinus signals to lure and eat males.