Automator Folder Action Help
Automator requires a graphical user session to run within. Regrettably, Automator can not run without a user session; this is because it is an application rather than a command line process.

Because of this requirement, running an Automator workflow at log-out is difficult. You need to run the workflow and delay the requested log-out until the workflow finishes.

If the tasks could be performed from a shell script, then this would be easier to hook into the log in and out steps.