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원환 헤테로환상의 치환기를 포함하는 신규한 인다졸- 유도체 또는 피롤로피리딘 유도체 및 그들을 포함하는 약제학적 조성물에 관한 것이다.