I don't like to have any open port when I am connected to a public WiFi, so I usually turn on the Block all incoming settings from the Firewall preferences.
So I decided to create this workflow to quickly set/unset this option.
fw: toggle the current setting
fw on: Enable block all incoming connections
fw off: Disable block all incoming connections
Attention: Preferences Panel must be closed when you use this workflow or the option will not be updated.