2

Using the Node client of Google Document AI we want to be able to check which review operations got completed after a certain time. However, it seems it's only possible to filter on CreateTime and not on UpdateTime: https://cloud.google.com/document-ai/docs/reference/rpc/google.longrunning#listoperationsrequest

For this reason, we'd like to delete completed operations that we already processed. We saw there is a deleteOperation method in the Node client, but even with the Document AI Administrator role, we're not allowed to delete a review operation:

Error: The caller does not have permission

If there any other way to know which review operations were completed besides polling all of them individually using for example cloud tasks?

dndr
  • 2,319
  • 5
  • 18
  • 28

1 Answers1

1

The DeleteOperation method is not implemented for Document AI, so it shouldn't be used for this use case. (The Node.JS Client library shows it for some reason, but it's not visible in the API Reference)

I've spoken with the product team to allow filtering by UpdateTime, this has been implemented and should be rolled out soon.

UPDATE: This has now been rolled out and the documentation is updated to reflect this functionality.

https://cloud.google.com/document-ai/docs/reference/rest/Shared.Types/ListOperationsRequest

You can filter by State to determine which operations are complete.

For example, set the filter as Type=HUMAN_REVIEW AND State=DONE to list all completed Human Review tasks.

Holt Skinner
  • 1,692
  • 1
  • 8
  • 21