if @task.invalid?
      render action: :edit, status: 422
    elsif @task.save
      redirect_to automation_tasks_path, notice: 'Task was successfully updated.'
    else