A method for controlling a production process performed by collaborating machines, M i , of an automation system (AS), wherein each collaborating machine, M i , of the automation system (AS) comprises an associated workflow execution context (WEC) of said collaborating machine, M i , stored in a local memory of said collaborating machine, M i , wherein the workflow execution context (WEC) of each collaborating machine, M i , includes a workflow, WF, of the respective collaborating machine, M i , and a precondition context associated with said workflow, WF, comprising preconditions for executing automated handling functions (AHFs) by the respective collaborating machine, M i , depending on the workflows, WFs, and automated handling functions (AHFs) of other collaborating machines, M i , of the automation system (AS), wherein each collaborating machine, M i , of the automation system (AS) comprises a collaborative workflow processor (CWP) having access to a shared database (SDB) of the automation system (AS) to determine workflow states, s, wherein the shared database (SDB) stores during operation of the automation system (AS) metadata about automated handling functions (AHF) having been executed by the collaborating machines, M i , and workflow states, s, of the collaborating machines, M i , communicated by the collaborative workflow processors (CWPs) to the shared database (SDB) of said automation system (AS), wherein the shared sequence of completed automated handling function (AHF) instances and workflow states, s, are processed by the collaborative workflow processors (CWPs) of the collaborating machines, M i , of said automation system (AS) to coordinate the automated handling functions (AHFs) between the collaborating machines, M i , during the production process. wherein each collaborating machine, M i , of the automation system (AS) comprises an associated workflow execution context (WEC) of said collaborating machine, M i , stored in a local memory of said collaborating machine, M i , wherein the workflow execution context (WEC) of each collaborating machine, M i , includes a workflow, WF, of the respective collaborating machine, M i , and a precondition context associated with said workflow, WF, comprising preconditions for executing automated handling functions (AHFs) by the respective collaborating machine, M i , depending on the workflows, WFs, and automated handling functions (AHFs) of other collaborating machines, M i , of the automation system (AS), wherein each collaborating machine, M i , of the automation system (AS) comprises a collaborative workflow processor (CWP) having access to a shared database (SDB) of the automation system (AS) to determine workflow states, s, wherein the shared database (SDB) stores during operation of the automation system (AS) metadata about automated handling functions (AHF) having been executed by the collaborating machines, M i , and workflow states, s, of the collaborating machines, M i , communicated by the collaborative workflow processors (CWPs) to the shared database (SDB) of said automation system (AS), wherein the shared sequence of completed automated handling function (AHF) instances and workflow states, s, are processed by the collaborative workflow processors (CWPs) of the collaborating machines, M i , of said automation system (AS) to coordinate the automated handling functions (AHFs) between the collaborating machines, M i , during the production process. <EOS>