The present invention relates to a novel indazole- or pyrrolopyridine-derivative comprising a 5 membered heterocyclic substituent at 1 position thereof which has an agonistic action or a partial agonistic action against serotonin-4 receptor, and a pharmaceutical composition comprising the same.本發明係有關對血清素-4受體具促效作用或部分促效作用之於其位置1含有5員雜環取代基之新穎之吲唑-或吡咯并吡啶-衍生物,及包含該等衍生物之醫藥組成物。