Automated unloading of workpieces