Where exactly is this supposed to happen?
Is it for some kind of download? Or just in the product card?
There is, for example, such an action
http://joxi.ru/vAWnJn7tq9WQ12Settings - other - automation for products
There are settings in the download for the promotion (assume that the product is in stock if all the components are in stock), and so on.