I made a similar workflow a while back and managed to bolt together a script filter which lets Alfred tell you if hidden files are currently visible or if they're hidden. This may or may not be useful to you
#!/bin/sh
#check the current value and display the result as subtitle
CURVALUE=$(defaults read com.apple.finder AppleShowAllFiles -bool)
if [ $CURVALUE = 0 ]; then
subtitle="Hidden files are currently invisible"
else
subtitle="Hidden files are currently visible"
fi
echo '<?xml version="1.0"?><items>'
echo "<item arg=\"{query}\" uid=\"ssid\" valid=\"yes\">"
echo "<title>Toggle hidden files</title>"
echo "<subtitle>$subtitle</subtitle>"
echo "<icon>icon.png</icon></item></items>"
echo "</items>"