JavaInterface step

In addition to the tasks described in the previous sections, user-defined tasks can be integrated directly in Java by implementing a defined interface. This has the advantage that the program code runs in the same instance as Cloudgene instead of creating a new process for every task. Thus, no command-line wrapper has to be written because the class has direct access to all input and output parameters.

Moreover, the task has much more capabilities to communicate with the workflow manager in order to transmit status updates and detailed error messages.


First, you have to create a new java project and include our genepi-hadoop library. We have a maven repository for that library:


The dependency is the following:


Next, you have to extend genepi.hadoop.common.WorkflowStep and implement the run method :

public class YourValidation extends WorkflowStep {

    public boolean run(WorkflowContext context) {

        //parameters defined in yaml file
        String input = context.get("input");
        String output = context.get("output");

        //your application logic

        //some outputs
        context.ok("okey message");
        context.error("error message");

        //true --> OK, false --> validation failed.
        return true;



After creating a jar archive for your project (for example by using maven), you can include your WorkflowStep into Cloudgene:

name: java interface example
version: 1.0
    - name: Input Validation
      jar: your-jar-file.jar
      classname: your.package.YourValidation
    - id: input
      description: Input Parameter
      type: text
    - id: output
      description: Output Parameter
      type: loca_file

A Eclipse project including a maven file and a cloudgene.yaml file can be forked here.