Barney is correct.
Once you run automator, you choose folder action as your document type. If you have your own AppleScript, Perl, Python, Ruby, or shell script, you would choose Library > Utilities and double-click your choice of “Run AppleScript,” or “Run Shell Script,” to place either in the workflow window. Save your workflow with a meaningful name. These are saved in your local Library/Workflows/Applications/Folder Actions.
Next, under System Preferences > Keyboard > Keyboard Shortcuts > Services, make certain that Folder Actions Setup... is checked.
And finally, right click the folder you want to attach your new folder action. At the bottom of the contextual menu will be a Services menu link whose separate menu now includes Folder Actions Setup... A drop down menu of scripts to attach to your folder will appear, so choose the name of your workflow that you saved from Automator.
You will now need to check Enable Folder Actions, and the “On” box for both the folder and the workflow in the adjacent panel. Now, if your code is good, the folder action will work.