Not getting uploaded file id immediately

Please use the search feature to find previous discussions about this topic. If you are developing external applications using Mayan, consider supporting the project with a support subscription Mayan EDMS or with via the new, low cost Knowledge base subscription Mayan EDMS community forum

In order to support scaling to millions of documents, almost everything in Mayan is an asynchronous operation, as such they happen at an undetermined time in the future. Attempting to acquire ID of new objects with long processing times is a paradigm of document management systems only meant for personal use and not suitable for large scale deployments. The document ID should be obtained in other ways depending on your workflow.

However, to fulfill this frequent request, we added a feature we call “immediate mode” to the sources system. Enabling this mode will provide a new document ID but will use an alternate code path that will disable performance and scaling features of Mayan and it is not suitable for mass uploads. Information about “immediate mode” is available in the release notes:

https://docs.mayan-edms.com/releases/4.5.html#sources

Support was added for single or multiple document API uploads. This feature is called immediate mode and allow receiving a document ID immediately after a file is submitted to a source via the API. This document ID allows working with the document while it is being processed. Since only one document ID can be returned per upload, using immediate mode will disable processing compressed files.

As well as a detailed Knowledge base article:

Sources API “Immediate Mode”

Other articles or discussions about or related to this topic:

Watch Folder/IMAP Source Processing

Background tasks

The event system

Document processing process