Can I run my workflow as a Web service?

There is no standard mechanism for creating a Web service from a workflow. However, there are ways to run a workflow as a Web service.

Several solutions for this have been made, one of them is the remote execution with the Taverna Server. This solution currently works only for Taverna 1.7.x workflows. The 2.x version of the Taverna Server is planned for the second half of 2010.

However – the remote executor service is designed for long-running workflow, so there is not a single “post and wait” method – you have to first upload your workflow, then your data (as a baclava document), then a job combining these two and putting it on the execution queue, then check the status of that job, check it again, check it again, ok, finished, then fetch the results (as a Baclava document).

The service uses Taverna 1.x under the hood, and the interface is a RESTful one. There is client libraries for Java, Python and Ruby. If you have a service, you can register it with myExperiment to execute workflows on your behalf.

As workflows are allowed to do all sorts of things, you should not have a general Web service open to the world to execute any random workflow. For instance, you could upload a workflow that contained a beanshell script that deleted all the files on the server. Or, a more likely way of abuse: start sending thousands of spam emails. There are two ways out of this:

  • Limit which workflows to run – someone will pre-approve a workflow, or
  • Limit which users are allowed to run workflows – someone will have to pre-approve the user

The execution service uses the second approach.

The Taverna team is investigating a service that takes an uploaded workflow, “approves” it, and then generates a WSDL interface for that particular workflow. The WSDL operation would then have input and output parameters matching the workflow input and output ports, so the caller would not need to know Baclava, what are the required ports, etc. – even that it is a Taverna workflow at all.

The caGrid team did a prototype that can do this “workflow as a service”. More details are available here.