String nodeId, boolean createIfNotPresent) throws RegistryException {
if (provenanceRegistry != null){
return provenanceRegistry.isWorkflowInstanceNodePresent(workflowInstanceId, nodeId, createIfNotPresent);
}
if (!isWorkflowInstanceExists(workflowInstanceId, true)){
throw new WorkflowInstanceDoesNotExistsException(workflowInstanceId);
}
if (jpa.getWorker().getWorkflowInstance(workflowInstanceId).isNodeExists(nodeId)){
return true;
}else if (createIfNotPresent){
addWorkflowInstanceNode(workflowInstanceId, nodeId);