The present invention provides substituted heterocyclylderivatives of formula (I), which are therapeutically useful, particularly as selective transcriptional CDK inhibitors including CDK7, CDK9, CDK12, CDK13 and CDK18, more particularly transcriptional CDK7 inhibitors. These compounds are useful in the treatment and prevention of diseases and/or disorders associated with selective transcriptional CDKs in a mammal. The present invention also provides preparation of the compounds and pharmaceutical formulations comprising at least one of the substituted heterocyclyl derivatives of formula (I) or a pharmaceutically acceptable salt or a stereoisomer thereof.