ResourceInstance createWorkflowResource(String clusterName, String workflowId) {
    Map<Resource.Type,String> mapIds = new HashMap<>();
    mapIds.put(Resource.Type.Cluster, clusterName);
    mapIds.put(Resource.Type.Workflow, workflowId);
    return createResource(Resource.Type.Workflow, mapIds);
  }
Create a workflow resource instance.

@param clusterName
         cluster name
@param workflowId
         workflow id

@return a workflow resource instance
ambari-server/src/main/java/org/apache/ambari/server/api/services/WorkflowService.java