def create
      @workflow = Workflow.new(workflow_params)


      respond_to do |format|
        if @workflow.save
          format.html {
            if(@workflow.stages.count > 1)
              redirect_to configure_stages_workflow_path(@workflow), notice: 'Workflow was successfully created. Please configure transitions.'
            else
              redirect_to @workflow, notice: 'Workflow was successfully created.'
            end

          }
          format.json { render json: @workflow, status: :created, location: @workflow }
        else
          format.html { render action: "new" }
          format.json { render json: @workflow.errors, status: :unprocessable_entity }
        end
      end
    end
def create
      @workflow = Workflow.new(workflow_params)


      respond_to do |format|
        if @workflow.save
          format.html {
            if(@workflow.stages.count > 1)
              redirect_to configure_stages_workflow_path(@workflow), notice: 'Workflow was successfully created. Please configure transitions.'
            else
              redirect_to @workflow, notice: 'Workflow was successfully created.'
            end

          }
          format.json { render json: @workflow, status: :created, location: @workflow }
        else
          format.html { render action: "new" }
          format.json { render json: @workflow.errors, status: :unprocessable_entity }
        end
      end
    end
POST /workflows
 POST /workflows.json