The present invention relates to N-(phenyl)-2-(phenyl)pyrimidine-4- carboxamide derivatives and related compounds of formula I as HPK1 (Hematopoietic progenitor kinase 1) inhibitors for treating cancer, such as e.g. breast cancer, colorectal cancer, lung cancer, ovarian cancer, and pancreatic cancer. Preferred compounds are e.g. N-(5-Fluoro-2-(2-(pyridin-2-yl)pyrrolidin-l-yl)phenyl)-2-(2- fluoro-6-methoxyphenyl)pyrimidine-4-carboxamide and N-(5-Fluoro-2- (hexahydropyrrolo[3,4-b]pyrrol-l(2H)-yl)phenyl)-2-(2-fluoro-6- methoxyphenyl)pyrimidine-4-carboxamide.