Document Processing with OCR and Q&A Workflow

This workflow automates document processing using the Mistral AI API in n8n for OCR and Q&A tasks. Key nodes include Document Processing Webhook for receiving POST requests, Validate Document Request to extract inputs, Check URL Provided and Determine Task Type for validation, Extract Text with OCR and Answer Question about Document for API interactions, and Process OCR/Q&A Result for formatting outputs. Setup Requirements: Install n8n by downloading from n8n.io for local setup or sign up at cloud.n8n.io for cloud access. For Mistral AI, visit mistral.ai, create an account, and obtain an API key from the dashboard. In n8n, go to Credentials > Add Credential > Mistral Cloud API, name it 'mistralApi', and enter the key. Configure the Document Processing Webhook node with a unique path (e.g., 'document-webhook'). Ensure Extract Text with OCR and Answer Question about Document nodes reference the 'mistralApi' credential and correct URLs. Missing credentials trigger an authentication error; verify the key. Missing document_url returns a 'Document URL is required' error with a 400 status code. Testing and Deployment: Import the JSON into n8n’s workflow editor. Test the webhook with a POST request (e.g., curl -X POST http://your-n8n-instance/document-webhook -d '{"url":"https://example.com/doc.pdf","task":"extract"}'). Validate outputs in Process OCR Result or Process Q&A Result nodes, checking fields like extracted_text, answer, or status. Ensure 'status: success' for valid operations. Handle errors like invalid URLs or failed API calls, which return empty results. Deploy by activating the workflow in n8n and integrating the webhook URL into your application. Monitor logs for issues like missing inputs or API errors to ensure reliable document processing and robust error handling.

$5.49

Workflow steps: 11

Integrated apps: webhook, set, if

Document Processing with OCR and Q&A Workflow  preview