DPU updates one resource type after the other and workflows come before functions. During the update of workflows the new function IDs are unknown because the entire processing of functions lies in the future.
The order in which resource types are processed is the following: keys, connections, data tables, workflows, production lines, functions, schedules, apps.
This order is based on the assumption that resources of types that come later use resources of earlier types but not the other way around. For function IDs in workflows that is not the case, that is why it works when you update it twice.
Thanks for your detailed answers, this explains very well what is happening here. I did not know that the order is important.
One more question I have:
Are UUIDs also replaced when they are hardcoded in Custom-Input-Tables or in some other processors?
So basically, does DPU replace any UUID, that it can resolve successfully, irrespective from the location it appears in the workflow json-representation?