Q:

Automator workflow hangs when run as folder action

I've got an Automator workflow that is supposed to backup the contents of my USB stick whenever I plug it in (after asking for a confirmation). It works if I trigger it manually within the Automator GUI. When I save it as a folder action, the workflow is triggered as expected (I get the confirmation prompt) but then gets stuck somewhere. 
What options do I have to find out what is going wrong? In what does the environment of the workflow differ when it's called as a folder action?

A:

Your script is only checking whether the encrypted volume exists, not the USB stick.
Make sure the folder action isn't triggered because of something else by adding a check for the destination volume to the workflow.
In general, if something's not working when automatically triggered, it's best to replicate as much as possible in a manually started process. In that case, executing within Automator or making it a service or application instead proved to be useful for finding the issue.

