Skip to main content

Wait for document

Wait until a document is read, or until it is also reviewed when it needs a review, then give its result.

Command in the Document Automation toolkit · id ooa.documents/wait_for_document · 4 inputs (1 required), 12 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Document IDStringYesThe document id that Send document to process gave (or a document_id input given by a Start-a-bot delivery).
UntilStringNoreadRead: until it is read (it may then wait for a review). Reviewed: also until a person has reviewed it, when it needs a review.
Timeout (seconds)NumberNo900Give up after this many seconds with the error DOCS.WAIT_TIMEOUT (a review may take hours).
Check every (seconds)NumberNo10How often to ask Document Automation.

Outputs​

OutputTypeWhat it is
statusStringThe document's status when the wait ended.
doneBooleanTrue when the document is no longer being read.
needs_reviewBooleanTrue while it waits for a person's review.
reviewedBooleanTrue when a person approved or rejected it.
fieldsDictionaryThe fields read, by name.
tablesDictionaryTable fields (such as line items), by name, each a Data table.
confidenceDictionaryHow sure the reading was for each field, from 0 to 1.
document_typeStringThe document type it was classified as.
file_nameStringThe document's file name.
reviewed_byStringWho approved or rejected it, when reviewed.
errorStringWhy reading failed, when it failed.
partsListWhen the file held several documents (a process that recognises and splits): each one's document_id, status, doc_type and file_name. Empty otherwise.