Recently I was asked to help solving an issues with a workflow. It had 95 actions, but taking care of the infopath form (was querying and updating its XML).
The workflow continuously was running into "Suspended" claiming that it is too large to persist, ex.:
RequestorId: 86e24769-e969-3395-0000-000000000000. Details: The workflow instance was too large to persist (over 9801 kilobytes uncompressed, over 6830 kilobytes compressed). The maximum persistable workflow instance size is 15360 kilobytes uncompressed and 5120 kilobytes compressed.
The workflow, when uncompressed had 1,2MB (http://help.nintex.com/en-US/O365/o365/O365WorkFlow/BestPractices/BP-Determinefilesize.htm) after I split it into 4 smaller, it's size decreased to 430KB. But even though, it is running slow and when I add a 2,5MB attachment to the InfoPath form (so that the form has like 3,6MB) the workflow gets suspended.
The only idea I have is that, the “Query XML” and “Update XML” actions are the reason. My guess is that to execute them Workflow has to “load” all the XML into the memory, so obviously unpack it to raw text. Now, having there the base64 encoded files makes a very large dataset. Then it has to find a proper path using the xpath query and do the requested action. I guess, this can be even done that way, that the workflow holds two instances of that XML – the original one, and the one on which it is working, so that it doubles the size of xaml file. But this is a guess only.
Anyway – when I created a simple workflow (10 actions, unpacked 80KB!) having no XML actions, not only it started extremely fast (whereas the workflows from the process takes long minutes to start and finish) it also gets completed extremely fast (seconds, really and on the same form, with the same attachments!)… The workflows with XML actions need long minutes to complete (ex. the first, having only 9-actions, needs 2 minutes!).
So to summarize – no matter what is done with the Nintex Workflow, this is not it’s fault. This is a fault of the SharePoint Workflow Manager engine, that handles the XML processing. And as long as the InfoPath form is used for that purpose, process will possibly get into issues.
Can anyone anyhow confirm, that my suspicions are correct?
Well basically it turns out that my guess was somehow correct, what was confirmed by Patrick Hosch on a side
So all Infopath users - be aware, because if you have many attachments and/ or large XML structure your workflows can suddenly get "Suspended" claiming, that their instances are just too large to persist.
Be aware, that InfoPath form, if you are using it as a form in the Forms Library, does not save any data from the XML to the SharePoint columns unless they are bond in the "Publishing" settings.