Automated loading of workpieces