A sequence in music occurs when a given melodic or harmonic passage is immediately repeated at a different pitch level. It is possible for melody or harmony to form a sequence without the other participating.
A sequence can be described according its direction (ascending or descending in pitch) and its adherence to the diatonic scale -- that is, the sequence is diatonic if the pitches remain within the scale, but chromatic (or non-diatonic) if pitches outside of the diatonic scale are used and especially if all pitches are shifted by exactly the same interval (i.e., they are transposed). The non-diatonic sequence tends to modulate to a new tonality or to cause temporarily tonicization.
At least two instances of a sequential pattern -- including the original statement -- are required to identify a sequence, and the pattern should be based on several melody notes or at least two successive harmonies (chords). Although stereotypically associated with the music of Antonio Vivaldi, this device is widespread in Western music history.
The following three-fold ascending chromatic (non-diatonic) sequence occurs in the duet of Abubeker and Fatima from Act III of César Cui's opera Prisoner of the Caucasus (compare a similar passage in the famous Rodgers and Hammersteinsong "Do-Re-Mi," composed almost exactly 100 years later):