Nintex workflow: Commit Pending Actions

In one Nintex workflow I have developed, I had a strange bug. In short:
  • the workflow updated the current item
  • and then removed the write rights to the item
Well, what is strange is that I had workflow errors, and logging in the history list, I could clearly see that some operations where logged before others, really difficult to understand...

In this article it is explained that some actions are batched, in particular when is a mix of SharePoint and Nintex workflow actions.

The solution is: use the Commit Pending Action.