how to build an automated