MacOS – Automator workflow runs forever

automatormacos

I have run into a problem with automator: I have a workflow that does image processing (it converts color images to gray). I am able to invoke the workflow from the terminal and it works fine. The command is:
automator -i infile.jpg imageconversion.workflow

However, I am facing a problem when I try to integrate this workflow in a webapp, build in Django and deployed with mod_wsgi on Apache. The workflow gets invoked (I can see this from the webapp logs), but it runs forever, and eventually apache will kill the child process after several minutes.

I am running OS X 10.9

Has anybody encountered a similar issue?

Thanks,
Gerald

Best Answer

Limitations of Automator

Your Automator workflow may require access to the WindowServer to work. Automator is designed to be run within an active user session, and not from a shell session.

The Apache user launching your Automator workflow is running without access to the WindowServer and this will likely limit which actions you can use.

ImageMagik

Consider using an image processing tool designed for command line use, such as ImageMagik. Take a look at the -greyscale option for your conversion:

convert in.png -grayscale Rec709Luminance out.png