I have a process builder flow, invoked when an instance of a custom object, A__c, is created. This process builder flow creates an instance of another custom object B__c. This custom object B__c has a trigger.
It seems that the trigger on B__c (before insert/before update) is not being invoked.
I'm aware of the order of execution being that processes are executed at the end of the transaction lifecycle, after all triggers, but would expect A__c's lifecycle to kick the creation of the B__c instance which would then cause B__c's lifecycle to be executed separately. Isn't that the case?
Could it be that the process builder flow is causing both insert and update but only invokes the trigger on insert (before the value the trigger uses in its logic is set)? (I said above it isn't invoked, but I'm not sure if that is 100% true - what I can say is that the expected code path in the trigger isn't invoked and I need to try adding some debug output to see exactly what happens. I will update the question when I can.)
The process builder uses "Create a Record", setting a number of field values by copying data from the contextual object (i.e. the object for which the process builder flow was invoked).
Is this expected behaviour?