The automation of workflows for the optimization of manufacturing processes through digital twins seems to be achievable nowadays. The enabling technologies of Industry 4.0 have matured, while the plethora of available sensors and data processing methods can be used to address functionalities related to manufacturing processes, such as process monitoring and control, quality assessment and process modelling. However, technologies succeeding Computer-Integrated Manufacturing and several promising techniques, such as metamodelling languages, have not been exploited enough. To this end, a framework is presented, utilizing an automation workflow knowledge database, a classification of technologies and a metamodelling language. This approach will be highly useful for creating digital twins for both the design and operation of manufacturing processes, while keeping humans in the loop. Two process control paradigms are used to illustrate the applicability of such an approach, under the framework of certifiable human-in-the-loop process optimization.