When an invoice is saved with this code, the workflow that executes on save of invoice does not execute - when the invoice record is saved manually, the workflow executes. The workflow has been stripped down to be as simple as possible - does the way the transform is saved affect workflow execution?