Skip to main content

mistralOcr

Runs Mistral OCR on a PDF document reachable via URL. Extracts the full text content, counts the pages, and collects any images found in the document. Images are returned as objects containing S3 paths. Actual API cost is tracked per-run.

Concurrency is capped at 3 simultaneous API calls. Retries up to 5 times with exponential backoff (base 2s, multiplier 2×, cap 32s).

Parameters

ParamTypeRequiredDescription
file_urlstring (URL)YesURL of the PDF document to process
entryobjectYesEntry data dict containing dataset_id and entry_id for routing and cost tracking

Output

FieldTypeDescription
textstringThe full extracted text from the document
imagesProcessedOCRImage[]List of processed image objects (see below)
numPagesintegerNumber of pages in the document

Each ProcessedOCRImage:

FieldTypeDescription
image_urlstring?S3 path to the uploaded image
image_typestring?MIME type of the image (e.g. image/jpeg)
widthinteger?Image width in pixels
heightinteger?Image height in pixels
note

The images output is intended to be forwarded as-is to a downstream saveEntries node.

Example

{
"id": "ocrNode",
"type": "mistralOcr",
"data": {
"label": "Mistral OCR",
"isExecuted": false,
"handles": ["inputs", "outputs"],
"schema": {},
"params": {
"file_url": { "value": "{{ @downloadEntry.file_url }}", "isExpression": true, "isAttachedToInputNode": false },
"entry": { "value": "{{ @fetchEntries }}", "isExpression": true, "isAttachedToInputNode": false }
},
"inputs": [], "outputs": [], "errors": []
},
"position": { "x": 300, "y": 0 },
"isSelected": false,
"isDragging": false
}