Many companies are considering greater automation as employment costs rise, but there are pitfalls