Alfred doesn't honor the option: “Reopen windows when logging back in”. This workflow gets around it by basically functioning like a macro. So if you see a glimpse of the confirmation dialog before the computer starts to shut down or whatever, that is completely normal.
If needed, hold down Cmd
when executing the action to stop at the confirmation dialog. You can use this confirmation dialog to change the “Reopen windows when logging back in”option without actually shutting down or restarting. Space
toggles it when the dialog is open.
The workflow was originally made for Alfred 3, but hsould work in future versions.
So that you don't accidentally use the wrong commands, you will want to disable all the equivalent commands that come with Alfred at:
Alfred Preferences > Features > System
- Shutdown
- Restart
- Logout
- Sleep