Repeated idempotent elements are commonly used to characterise iterable behaviours in abstract models of computation. Therefore, given a monoid M , it is natural to ask how long a sequence of elements of M needs to be to ensure the presence of consecutive idempotent factors. This question is formalised through the notion of the Ramsey function RM of a finite monoid M , obtained by mapping every k ∈ N to the minimal integer RM (k) such that every word u ∈ M * of length RM (k) contains k consecutive non-empty factors that correspond to the same idempotent element of M .In this work, we study the behaviour of the Ramsey function RM by investigating the regular D-length of M , defined as the largest size L(M ) of a submonoid of M isomorphic to the set of natural numbers {1, 2, . . . , L(M )} equipped with the max operation. We show that the regular D-length of M determines the degree of RM , by proving that kTo allow applications of this result, we provide the value of the regular D-length of diverse monoids. In particular, we prove that the full monoid of n × n Boolean matrices, which is used to express transition monoids of non-deterministic automata, has a regular D-length of n 2 +n+2 2 .