this workflow enable/disable autohide feature, it does the same job as open System preferences->General->check/uncheck "Automatically hide and show the menu bar", just automatically. make sure to give it proper access under "Security & Privacy". you may need to go under "security & Privacy" -> "Privacy" and remove than added "alfred" after update or after first install
N.B: Tested under MacOS mojave 10.14.5.