Insufficient stock

I am developing a stock management application but when the stock reaches 0 and the user tries to exit a product the stock goes into the negative
how to put a barrier when the stock reaches 0 and signal to the user that the stock is empty and that an exit is no longer possible?

Using conditions in the only when field, doesn’t help?

image

Use the <-max-> operator.

I haven’t tried this possibility yet, I’m a beginner
thanks

thanks

you may still run into issues if more than one user concurrently trigger this workflow.

I see how to also solve this problem definitively