Document To Image
Convert a document into images so a model can see its layout.
Document To Image converts an existing document — PDF, DOCX, XLSX — into one or more raster images (PNG by default), one per page or sheet.
The point is not the file format. It's that many capable models are trained to see: layout, position, and visual structure carry meaning that flat extracted text loses. Converting first lets the agent look at a document rather than only read it.
How it works
Input resolution — uses
$input(the previous skill's output),$agent(agent-level variables), and$secret(vault secrets).Processing:
Pulls the source file from internal storage using
documentId.Streams pages/sheets to the rendering engine, respecting
pageLimit.Encodes each page/sheet as an image and writes it to
outputStorage.Generates lightweight metadata — page number, sheet name — for each rendered image.
Execution — blocking, typically completing in one invocation for 50 pages or fewer. Large files may be handed to an async worker, but the skill still behaves as blocking.
Response:
Success — an
imagesResultarray, one entry per page/sheet.Partial — some pages failed; the error message explains which.
Failure — unrecoverable errors, such as an unconvertible format, throw a workflow-catchable exception.

Worked example: visually classifying financial statements
A workflow receives a mix of financial documents — PDF tax returns, scanned balance sheets that are also PDFs. The agent needs to classify them: is this a balance sheet or an income statement? The visual layout usually answers that faster and more reliably than the text does.
The problem. Models that classify well from images can't read a raw PDF the same way. Handing over the file directly wastes the visual cues that make the classification easy.
The approach. Put a Document To Image skill between the upload and the classifier. Convert the document to page images, then pass those to a reasoning or classification step.
Set pageLimit deliberately — for classification you usually need the first page, not all forty. Every extra page is render time and model cost for information that doesn't change the answer.

Configuration reference
documentId
string
✅
The document to convert.
source
string
✅
conversation for a temporary file, storage for a persistent one.
sourceStoragePath
string
—
The path, when source='storage'.
pageLimit
number
—
Maximum pages to convert, starting at page 1.
outputStorage
string
—
conversation (default) or storage — where images are written.
outputstoragePath
string
—
Allowed when outputStorage='storage'.
name
string
—
Display name for this skill instance.
description
string
—
Longer description shown in the builder.
Output
statusCode
number
✅
HTTP-like — 200 success, 400/500 error.
error
string | null
—
Populated when statusCode is above 200.
imagesResult
array
✅
One entry per converted page/sheet.
Each entry in imagesResult:
images
array
Each rendered image, as { documentId: string }.
sheetName
string
Source sheet name, for spreadsheet input.
pageNumber
number
Source page number.
Each rendered image gets its own documentId, so downstream skills treat it exactly like any other document.
Errors
DocumentNotFoundError
Invalid or inaccessible documentId.
UnsupportedFormatError
The file type cannot be converted.
RenderTimeoutError
Exceeded the platform time-box for large files.
Each surfaces with an error status and a descriptive message.
Testing in isolation
Path —
/skill-runtime/workflows/nodes/DocumentToImage/executeMethod —
POSTBody:
To add this skill to an agent, see Adding a Skill to the Agent.
Last updated

