This invention relates to a class of pyrrolidine compounds of formula (I), and pharmaceutically acceptable derivatives thereof, to their use in medicine, to compositions containing them, and to processes for their preparation. It also relates to intermediates used in the preparation of such compounds and derivatives. In particular the compounds of formula (I) are useful for the treatment of EP2-mediated conditions, such as endometriosis, uterine fibroids (leiomyomata), menorrhagia, adenomyosis, primary and secondary dysmenorrhoea (including symptoms of dyspareunia, dyschexia and chronic pelvic pain), chronic pelvic pain syndrome.