Hi Diego, this is maybe due to the following limitation of the Microflow used in the PDF document generation action (see documentation):
Generate PDF from page
action are not available to use in your PDF document. This is also applicable for changes made to existing objects. The reason is that those changes are not persisted to the database until the whole microflow has finished. The document generation service will access your document in its own context, and therefore have no access to the non-persisted changes.
A potential workaround is to the EndTransaction
action from Community Commons module, although it is important to realize the effects of using this action is that it prevents rollbacks of the actions before the EndTransaction.