As suggested by @ltdrdata, we can automatically consider nodes that take the UNIQUE_ID hidden input to be NOT_IDEMPOTENT.