MistralOCR
This component reads text and structural details from images and PDF files. It uses powerful AI vision models to not only recognize words but also understand how they are arranged on a page, making it ideal for processing forms, reports, invoices, and other documents that need accurate formatting and organization.
How it Works
When you send an image or PDF to this component, it automatically converts the file into a format that AI models can understand. It then connects to the Mistral AI cloud service to analyze the visual content. The AI reads the text, identifies page boundaries, and maps out where each piece of text is located on the document. Finally, it packages the recognized text along with layout information (like page numbers and exact positions) so you can easily use it in your automation flows.
Connection & Credentials
This component requires configuring a credential in the Nappai panel before interacting with the external service:
- Go to the Credentials section in your Nappai panel.
- Create a new credential of the type specified for this component and fill in the required fields (API Keys, tokens, etc.).
- In your workflow, select the saved credential in the Credential input field of this node.
💡 You can get your API key from the official Mistral AI console here.
Inputs
Mapping Mode
This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:
- Fixed: You type the value directly into the field.
- Mapped: You connect the output of another component to use its result as the value.
- Javascript: You write Javascript code to dynamically calculate the value.
This flexibility allows you to create more dynamic and connected workflows.
Input Fields
The following fields are available to configure this component:
- Image / File: The source document or picture you want to read text from. Accepts images, PDF files, or direct file uploads.
- Visible in: Default
- PDF Processing / Layout Mode: A toggle that helps the component handle multi-page documents and complex layouts. When enabled, it ensures each page is processed separately and keeps the original structure intact.
- Visible in: Default
Outputs
This component returns the recognized text along with detailed layout information. Depending on how you set up your workflow, the output can be a simple text string or a structured list containing page numbers, confidence scores, and exact coordinates for each recognized text block. You can then pass this information to other components for further processing, storage, or AI analysis.
Output Data Example (JSON)json
{ “pages”: [ { “page_index”: 0, “confidence”: 0.98, “bounding_boxes”: [ { “text”: “Invoice #10234”, “x”: 150, “y”: 200, “width”: 300, “height”: 40 }, { “text”: “Total Due: $1,500.00”, “x”: 450, “y”: 800, “width”: 250, “height”: 35 } ] } ] }
Connectivity
This component is typically placed at the beginning of a document processing workflow. It works best when connected to:
- Text processors or form fillers that need raw text to populate databases or forms.
- AI Assistants or LLM nodes that require structured text and layout data to analyze documents or answer questions.
- Data storage or export nodes that need to save extracted information in a specific format. Its layout-aware output makes it especially useful when feeding into nodes that organize data into tables, generate reports, or route documents based on their content.
Usage Example
Scenario: Extracting Data from Scanned Invoices
- Upload a scanned invoice image or PDF into the Image / File field.
- Enable PDF Processing / Layout Mode to ensure page breaks and table structures are preserved.
- The component reads the document and outputs the text along with its exact positions on the page.
- Connect the output to a data mapping node to automatically fill in fields like “Invoice Number” and “Total Amount” into your accounting system.
Tips and Best Practices
- Use high-resolution images or clear PDF scans for the best accuracy.
- Enable PDF Processing / Layout Mode when processing documents with tables, headers, or multiple pages to preserve the original structure.
- If the document is text-heavy and you only need plain text, you can skip layout mapping to save processing time.
- Always test with a sample document first to ensure the AI recognizes the text formatting correctly.
Security Considerations
- Keep your Mistral AI API key secure and never share it publicly. Only authorized team members should have access to your credentials.
- Be mindful of the data you send to the AI service. Avoid uploading sensitive or confidential documents unless your organization’s data privacy policies allow external AI processing.
- The component processes documents in the cloud, so ensure your workflow complies with your company’s data handling and retention guidelines.