How to use grunt for workflow automation

What is workflow automation: In the new era of development its not limited itself with doing coding and manual testing of functionality on server. The era has been changed now, CSS are coming after compilation from pre-processors, code are being validated through tools like JShint (to avoid any wrong code is not written), TDD, BDD(…)