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"]How it works
Section titled “How it works”- Asks Zoan Cloud for the confirmed bundles (up to
limit). - For each one, downloads the file to
outputDiras<id>-<original name>(creating the folder if it does not exist) and, if the bundle has an OCR cache, downloads it alongside (….layout.json). - Marks it as taken, so it is not returned again.
- 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.
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
limit | int | 50 | Maximum bundles to take at once. |
outputDir | string | the system temp folder | Where to download the files. Created if it does not exist. |
Output
Section titled “Output”A List<object> of bundles; each one:
| Field | Type | What it is |
|---|---|---|
id | string | The bundle’s id in Zoan Cloud. |
reference | string | The key it was uploaded with. |
path | string | The local path of the downloaded file. |
segments | List | The confirmed segments: [{ pageStart, pageEnd, type, recognized }]. |
document | Dictionary | The full reading stored as an OCR cache, or null if the bundle has none. |
The reading comes back with the bundle
Section titled “The reading comes back with the bundle”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.
Idempotency
Section titled “Idempotency”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.
Example
Section titled “Example”Extract each confirmed segment with its own reference, grouped by the source bundle:
Documents — Take Confirmed Bundles limit = 20 outputDir = workFolder → output: bundlesFor 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"])Common errors
Section titled “Common errors”| Message | Cause 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. |
Related activities
Section titled “Related activities”- Documents — Send Bundle to Classification — sends the uncertain bundle to the station.
- IDP — Extract — extracts each confirmed segment.