Skip to content

Documents — Take Confirmed Bundles

Type: documents-take-classified  ·  Package: Documents Activities v1.4.5  ·  Output: List<object>

Since: v1.3.0

Picks up the bundles whose split a person has already confirmed in the classification station. It downloads each one’s file, takes it out of the inbox (so it isn’t processed twice) and returns them with their local path and their confirmed segments. The playbook iterates and extracts each segment.

Documents — Take Confirmed Bundles → output: bundles
For Each items = bundles itemVariable = bundle
└── For Each items = bundle["segments"] itemVariable = segment
└── IDP — Extract path = bundle["path"]
document = bundle["document"]
project = segment["type"]
pages = segment["pageStart"] + "-" + segment["pageEnd"]
  1. Asks Zoan Cloud for the confirmed bundles (up to limit).
  2. For each one, downloads the file to outputDir as <id>-<original name> (creating the folder if it does not exist) and, if the bundle has an OCR cache, downloads it alongside (….layout.json).
  3. Marks it as taken, so it is not returned again.
  4. Returns the list. The log says how many bundles it took.

With no confirmed bundles, it returns an empty list. It needs the Zoan Cloud runtime context.

None.

ParameterTypeDefaultDescription
limitint50Maximum bundles to take at once.
outputDirstringthe system temp folderWhere to download the files. Created if it does not exist.

A List<object> of bundles; each one:

FieldTypeWhat it is
idstringThe bundle’s id in Zoan Cloud.
referencestringThe key it was uploaded with.
pathstringThe local path of the downloaded file.
segmentsListThe confirmed segments: [{ pageStart, pageEnd, type, recognized }].
documentDictionaryThe full reading stored as an OCR cache, or null if the bundle has none.

If the bundle was uploaded with its OCR cache (the document from Documents — Send Bundle to Classification), each returned bundle carries document: the full reading. Pass it to IDP — Extract together with each segment’s range (pages) and the extraction slices that reading instead of re-reading — the same paper is not paid for twice. If there is no cache (or it could not be downloaded, which leaves a warning in the log), document comes empty and extraction goes by path as usual.

Taking a bundle marks it as taken, so it is not returned again. If extracting a segment fails, IDP — Extract’s idempotency (by reference) avoids paying again for the segments already extracted on a retry.

Extract each confirmed segment with its own reference, grouped by the source bundle:

Documents — Take Confirmed Bundles limit = 20 outputDir = workFolder
→ output: bundles
For Each items = bundles itemVariable = bundle
For Each items = bundle["segments"] itemVariable = segment
IDP — Extract path = bundle["path"]
document = bundle["document"]
project = segment["type"]
pages = segment["pageStart"] + "-" + segment["pageEnd"]
reference = bundle["reference"] + "#" + segment["pageStart"]
sourceGroupId = bundle["reference"]
→ output: res
Log message = res["reference"] + " to review: " + toString(res["needsReview"])
MessageCause and fix
Document activities need a Zoan Cloud runtime context, which the Runner provides when it launches the playbook. Missing: …. …The run has no Zoan Cloud. Run it from Zoan Cloud or from the Designer with a session.
Zoan Cloud rejected the request (…): …Zoan Cloud did not accept the query, the download or the taken mark. The detail carries the code; retry.
Layout cache unavailable (…); the extractor will re-read the file. (warning)The OCR cache could not be downloaded. It does not fail: IDP — Extract will read the file.