ai.vision: Inspect rendered page images with a vision model and return structured JSON matching a schema. The visual counterpart to Extract Data: use it for conclusions that live in the pixels rather than the text (is the document signed? are the photos usable?). Renders PDF, image, or Office/Word inputs; route to specific pages with an ai.split page range to keep it cheap.
Configuration
Configuration goes inside the step’swith: block.
First page to inspect (0-based, inclusive). Optional. Accepts a template expression. When omitted, starts from the first page.
Last page to inspect (0-based, inclusive). Optional. Accepts a template expression. When omitted, runs to the last page. When BOTH pageFrom and pageTo are omitted, the whole document is inspected in chunks of maxPages (divide-and-conquer, results merged).
Explicit list of 0-based page indices to inspect, supports NON-contiguous selections, e.g. [4, 11, 19], or a template resolving to a number[] such as ”{{ steps.label_pages.output.byLabel.photo }}”. Highest priority: when set, pageFrom/pageTo and pages are ignored.
JSON Schema defining the structure the vision model should return. Fields not listed in
required come back null when not found; a missing required field fails the step.Reasoning effort for models that support it. Omit to use the selected model’s default.
PDF render scale (1.0 = 72 DPI). Raise for small text or weak VLM OCR. Capped at 6 to avoid oversized page rasters.
Chunk size: the maximum pages sent to the vision model in a single call. When the inspected range (or the whole document) is larger, it is split into chunks of this size and the per-chunk results are merged by a reduce pass. The reduce follows each field’s DESCRIPTION: a boolean described as “present on any page” is OR-ed, one described as “true for every page” is AND-ed, and list fields are concatenated. The merge is most reliable for boolean/scalar claims; for schemas that AGGREGATE long lists across chunks it can still drop or reorder items, so prefer a bounded page range for large list extraction. Default 20, capped at 100.
Output
Returnsrecord<string, unknown>. Structured data matching the provided schema. The output also carries a reserved _vision key recording the inspected source document ref and the page indices that were rendered, so the UI can re-rasterize exactly those pages client-side. _vision is excluded from user-schema validation.