Reference · Tools
Mistral AI OCR
Extract text from documents and images using Mistral AI\
The Mistral AI OCR node extracts text from PDFs and images, taking the document as binary data or a URL, with a batch mode for processing many documents in one go. A typical build is turning a folder of scanned contracts into searchable text before indexing it.
- Node type
- Action (binary)
- Parameters
- 11
- Outputs
- Output, Error
- Credentials
- Mistral AI API
Mistral AI OCR
Extract text from PDFs and images using Mistral AI OCR
Overview
The Mistral AI OCR tool uses the Mistral AI OCR API to extract text from PDF documents and images. It accepts input as binary data (from upstream nodes) or as a URL. The API returns structured page-level results with markdown text, image coordinates, dimensions, and hyperlinks. Supports batch processing for multiple documents in a single efficient API call. Outputs extracted text as JSON with convenience fields (extractedText, pageCount). The original binary data from the input item is forwarded unchanged on the output.
Category: Utility
Tool Name: mistral_ai_ocr
Version: 1
Appearance: Icon: lucide-ScanLine | Color: #FF7000
Node Type
Action (Binary) — handles file/binary data operations
Input / Output
| Direction | Port(s) |
|---|---|
| Input | Input |
| Output | Output, Error |
Credentials
This tool requires Mistral AI API credentials. See the Credentials Guide for setup instructions.
Resources
| Resource | Value |
|---|---|
| Document | document |
Operations
| Operation | Value | Description |
|---|---|---|
| Extract Text | extractText | Extract text from a document or image using OCR |
Parameters
Document: Extract Text
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Model | options | Yes | mistral-ocr-latest | The OCR model to use for text extraction. |
Options: mistral-ocr-latest | ||||
| Document Type | options | Yes | document_url | The type of document to process. Choose “Document” for PDFs or “Image” for image files. |
Options: document_url (a PDF document), image_url (an image file — JPEG, PNG, etc.) | ||||
| Input Type | options | Yes | binary | How the document will be provided. When batch mode is enabled, only binary data input is supported. |
Options: binary (read the document from a binary property on the input item), url (provide a URL to the document or image) | ||||
| Input Binary Field | string | Yes | data | Name of the binary property containing the file to process. Uploaded document files must not exceed 50 MB in size and should be no longer than 1,000 pages. Names are case-sensitive — see the upstream node’s Binary Data panel for the exact names to use. (shown when Input Type is binary) |
| URL | string | Yes | — | URL of the document or image to process. Enter a literal URL — this field does not evaluate {{ }} expressions. (shown when Input Type is url) |
| Enable Batch Processing | boolean | No | false | Whether to process multiple documents in a single batch API call. More cost-efficient for processing many documents. Only binary data input is supported in batch mode. |
| Batch Size | number | Yes | 50 | Maximum number of documents to process in a single batch file. Between 1 and 2048. (shown when Enable Batch Processing is true) |
| Delete Files After Processing | boolean | No | true | Whether to delete the uploaded files on Mistral Cloud after batch processing completes. (shown when Enable Batch Processing is true) |
All Operations
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| Max Concurrency | number | No | 5 | Maximum number of items to process concurrently in single (non-batch) mode. Between 1 and 50. |
Output Data
The OCR result is merged onto the input item JSON — the incoming fields pass through unchanged, and the original binary data is forwarded untouched, so a downstream node can still read the source file. One output item per input item; the node never fans out, in either single or batch mode.
Merged onto each item:
| Field | Description |
|---|---|
pages | The page-level results from the API. Each page carries its markdown text, plus image coordinates, dimensions and hyperlinks. |
extractedText | Convenience field — every page’s markdown joined together with a blank line between pages. This is the field most workflows read. |
pageCount | Convenience field — the number of pages in pages. |
The remaining fields of the API’s OCR response are merged alongside these.
Reference the result downstream by expression, e.g. {{ $json.extractedText }} or {{ $json.pageCount }}.
Usage Examples
- Extract text from a PDF document using OCR
- OCR an image to get text content
- Batch process multiple PDF documents for text extraction
- Extract text from a document URL without binary data
- Get page-level markdown from a scanned document
Example Configuration
Read a PDF from an upstream node’s binary output and OCR it:
{
"type": "mistral_ai_ocr",
"parameters": {
"resource": "document",
"operation": "extractText",
"model": "mistral-ocr-latest",
"documentType": "document_url",
"inputType": "binary",
"binaryPropertyName": "data",
"maxConcurrency": 5
}
}
OCR an image that lives at a fixed URL — no upstream file needed:
{
"type": "mistral_ai_ocr",
"parameters": {
"resource": "document",
"operation": "extractText",
"model": "mistral-ocr-latest",
"documentType": "image_url",
"inputType": "url",
"url": "https://example.com/image.jpg"
}
}
High-volume PDF processing — batch 20 documents per API job and clean up afterwards:
{
"type": "mistral_ai_ocr",
"parameters": {
"resource": "document",
"operation": "extractText",
"model": "mistral-ocr-latest",
"documentType": "document_url",
"inputType": "binary",
"binaryPropertyName": "document",
"batch": true,
"batchSize": 20,
"deleteFiles": true
}
}
Single-document mode against a non-default binary field, with concurrency raised:
{
"type": "mistral_ai_ocr",
"parameters": {
"resource": "document",
"operation": "extractText",
"model": "mistral-ocr-latest",
"documentType": "document_url",
"inputType": "binary",
"binaryPropertyName": "attachment",
"batch": false,
"maxConcurrency": 10
}
}
Error Handling
| Mode | Behavior |
|---|---|
| stop | Halts workflow on first error |
| continue | Skips failed items, passes successful ones through |
| errorPort | Routes failed items to Error output port |
Tips
Extract text from PDF documents and images using Mistral AI OCR API — supports binary data or URL input with optional batch processing.
Important Notes
- Batch Mode Restriction: When
batchistrue, onlyinputType: "binary"is supported - File Constraints: Binary files must not exceed 50 MB and should be no longer than 1,000 pages
- Cost Efficiency: Use batch mode for processing multiple documents to reduce API costs
- Concurrency: The
maxConcurrencyparameter only applies to non-batch processing modes
Behavior notes
- Match Document Type to the file.
document_urlis for PDFs andimage_urlis for images; picking the wrong one makes the API reject the file even though the binary data is fine. - Batch mode waits for the whole job. The node uploads the documents, starts the batch job and waits for it to finish before emitting any item, so a batch run takes as long as its slowest job. Single mode emits each item as soon as its own request returns.
- Delete Files After Processing only affects the copies on Mistral Cloud. The binary data on your workflow items is never touched.
- Parameters are used literally. Fill them in on the node rather than trying to compute them per item with
{{ }}expressions.
Frequently asked questions
What are the file limits?
Binary files must not exceed 50 MB and should be no longer than 1,000 pages. Larger documents need splitting before they reach the node.
What does batch mode change?
Batch processing reduces API costs when handling many documents, but it only supports binary input — with batch on, URL input is not available.
When does Max Concurrency apply?
Only outside batch mode. In batch mode the API handles the grouping, so the node's concurrency setting has nothing to control.
Which credential does it need?
A Mistral AI API credential.
Build with the Mistral AI OCR node
Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Mistral AI API credentials first.
Open BusyBotLast updated . Spotted something wrong? Tell us.