The present invention relates to cyclic azaindole-3-carboxamides of the formula I,wherein A, R, R10, R20, R30, R40, Y1, Y2, Y3, Y4, n, p and q have the meanings indicated in the claims, which are valuable pharmaceutical active compounds. Specifically, they inhibit the enzyme renin and modulate the activity of the renin-angiotensin system, and are useful for the treatment of diseases such as hypertension, for example. The invention furthermore relates to processes for the preparation of the compounds of the formula I, their use and pharmaceutical compositions comprising them.