Automate optimization with triggers