I had a similar question and with the help of wch1zpink came up with this solution. In automator:
create a new workflow
add get selected finder items
add run applescript
replace the script with this:
tell application "Finder"
set selectedFiles to selection as alias list
set containingFolder to container of item 1 of selectedFiles as alias