Not sure if you need this solution : I have assume a DataGrid input passing the inventory value and used a JavaScript Step to compare the values (check the 2nd image). I have hardcoded the value of existence for testing purpose.If the condition is True, set a variable and then use a Filter Step to send out the mails.


This is a very simple example. Not sure if this is what you are looking for. By the question posted, if you are looking for doing all the above using JS, then you have to write codes for Mail in JavaScript.
Hope it helps :)
STEP by STEP Explaination:
Data Grid - it holds the input data. In your case, the values of "inv_product.min_exi". This can be any source.. You can use Table Input Step also and a PostgreSQl database.
Modified JavaScript Value - Use this step to do a initial checking condition. In your case "existence <= inv_product.min_exi". You can also do any other Javascript checkings. In the example i have given, i have considered the value of existence to be equal 2. But if the value of existence is dynamic or coming from a different source, you can remove this hardcoded value and use a dynamic input streaming.
Now if a condition is getting satisfied, you can assign a value to a variable like "flag_ex = 1" or "flag_ex=0".
Filter rows - You can filter out the input stream based on the flag_ex value. As per my example, if flag_ex=1 then it satisfies true else false.
Mail - Finally send out Mail of the True conditions.