Document Understanding/Action Center - Parallel For Each Issues when# of Documents > ~20

I currently have a document understanding POC going where the bot does the following:

  1. Get all paths from the document folder.
  2. Runs a parallel for each to do the steps below.
  3. Digitize the doc
  4. Classify the doc
  5. If the classification confidence is below x. create action center verification/wait objects
  6. Extract data
  7. If extraction confidence is below x, create action center verification/wait objects
  8. Export results to excel

This works perfectly as expected until I try running the process for ~20 or more documents. Then I start getting out of memory errors. I looked on these boards and found that the issue is due to running a parallel for each during the digitization step which takes a ton of memory.

I saw someone suggest to do the digitization/classification in a parallel for each, and then handle the confidence check/creation of action center verification/wait objets in a parallel for each loop.

I tried this approach by digitizing/classifying my documents in a for each and storing the path, document text, document object model, and classification results in a data table. Then in my parallel loop, I loop thorugh the paths and pull the correct row of data from the data table by matching the path.

The end result is that my bot correctly digitizes and classifies each invoice and then even creates the validation actions in action center correctly. However, after I validate the classification in action center and resume the process, the bot crashes with one of the two error messages below:

Message: Type ‘UiPath.DocumentProcessing.Contracts.Dom.Document, UiPath.DocumentProcessing.Contracts, Version=1.10.0.0, Culture=neutral, PublicKeyToken=null’ is not allowed here. See https://go.microsoft.com/fwlink/?linkid=2132227 for more information.

or

Message: Could not retrieve the result of the job execution. This might be because a message was too large to process.

Any advice would be helpful here. I am sure a lot of you have figured out how to utilize document understanding with the action center instead of the validation station for verification at scale. Thanks!

1 Like

Hi, do you have any solution for this? I am facing the same issue. Any help would be appreciated.

The link you posted in the error message says you can only store certain types in a DataTable, for security reasons. These are all .net types from the .net framework, so Contracts like ‘Document’ are not supported. You can try to serialize them to a string and store the string instead

Hey Vinay,

Are you on community edition? Once we upgraded to enterprise the memory issue was no longer happening even with 0 change to the code…so not sure exactly what fixed it as I thought the functionality should be the same.

Hi Ango, no we are on enterprise version. What version of intelligent automation and document understanding version packages are you using?