how to automate task