func hasNoActiveWorkflow(c config.Cpi, nodeID string) bool {
	log.Debug(fmt.Sprintf("Getting active workflow"))
	workflow, err := rackhdapi.GetActiveWorkflows(c, nodeID)
	if err != nil {
		log.Error(fmt.Sprintf("Error getting active workflow on node %s: %v\n", nodeID, err))
	}
	return reflect.DeepEqual(workflow, rackhdapi.WorkflowResponse{})
}
func nodeIsAvailable(c config.Cpi, n rackhdapi.Node) bool {
	log.Debug(fmt.Sprintf("Getting active workflow"))
	workflow, err := rackhdapi.GetActiveWorkflows(c, n.ID)
	if err != nil {
		log.Error(fmt.Sprintf("Error getting active workflow on node %s: %v\n", n.ID, err))
	}
	log.Debug(fmt.Sprintf("Getting OBM settings"))
	obmSettings, err := rackhdapi.GetOBMSettings(c, n.ID)
	if err != nil {
		log.Error(fmt.Sprintf("Error getting OBM settings on node %s: %v\n", n.ID, err))
	}

	return (n.Status == "" || n.Status == rackhdapi.Available) &&
		(n.CID == "") &&
		reflect.DeepEqual(workflow, rackhdapi.WorkflowResponse{}) &&
		(len(obmSettings) > 0) &&
		!hasPersistentDisk(n)
}
			It("returns a node's active workflow", func() {
				rawWorkflow := helpers.LoadJSON("../spec_assets/dummy_workflow_response.json")
				httpResponse := []byte(fmt.Sprintf("%s", string(rawWorkflow)))
				var expectedResponse rackhdapi.WorkflowResponse
				err := json.Unmarshal(httpResponse, &expectedResponse)
				Expect(err).ToNot(HaveOccurred())

				nodeID := "nodeID"
				server.AppendHandlers(
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("GET", fmt.Sprintf("/api/1.1/nodes/%s/workflows/active", nodeID)),
						ghttp.RespondWith(http.StatusOK, httpResponse),
					),
				)

				response, err := rackhdapi.GetActiveWorkflows(cpiConfig, nodeID)
				Expect(err).ToNot(HaveOccurred())
				Expect(server.ReceivedRequests()).To(HaveLen(1))
				Expect(response).To(Equal(expectedResponse))
			})
		})

		Context("there is no running workflow", func() {
			It("returns nil", func() {
				nodeID := "nodeID"
				server.AppendHandlers(
					ghttp.CombineHandlers(
						ghttp.VerifyRequest("GET", fmt.Sprintf("/api/1.1/nodes/%s/workflows/active", nodeID)),
						ghttp.RespondWith(http.StatusNoContent, []byte{}),
					),
				)