AI research agents to automate PDF analysis with Mistral’s best-in-class OCR
Overview
Mistral OCR is a cutting-edge document understanding API that improves how businesses extract and process information from complex documents. With top scores in benchmarks for accuracy and comprehension capabilities, Mistral OCR handles multi-column text, charts, diagrams, and multiple languages.
This workflow uses Mistral's Document understanding OCR API to automatically turns dense PDFs (such as financial reports) into either deep research reports or concise newsletters
Key Features
- Superior Document Understanding: Processes complex documents with high-fidelity rendering
- Multi-Format Support: Handles PDFs containing text, images, charts, and diagrams
- Multilingual Capabilities: Accurately processes documents in various languages
- Seamless API Integration: Easy implementation through cloud-based API
- Customizable Research Depth: Generate comprehensive 8-page reports or concise 1,750-word newsletters
How It Works
-
Document Upload: Submit your PDF through an n8n form interface.
-
Output Format Selection: Choose between comprehensive deep research (3,500 words) or Concise newsletter (1,750 words)
-
Custom Instructions: Tailor the analysis by adding specific focus areas (e.g., quantitative data, growth catalysts).
-
AI Processing: The document undergoes multi-stage AI analysis: OCR and text extraction using Mistral AI and Content structuring and summarization using GPT models
Agents:
- Research Leader: Plans and conducts initial research, creating a table of contents.
- Project Planner: Breaks down the table of contents into manageable sections.
- Research Assistants: Multiple agents that conduct in-depth research on assigned sections.
- Editor: Compiles and refines the final article, ensuring coherence and proper citations.
Setup
- API Key Acquisition:
- Obtain an API key from OpenRouter.ai
- Get an API key from Mistral.ai
- n8n Configuration:
- In your n8n instance, navigate to the credentials section.
- Create new credentials for OpenRouter and Mistral, inputting the respective API keys.
- Form Configuration:
-
Customize the input form fields if needed (e.g., adding company-specific options).
-
Output Customization: Adjust the word count parameters in the Project Planner node to change output length.
n8n AI-Powered PDF Analysis with Mistral OCR
This n8n workflow leverages AI agents and OCR capabilities to automate the analysis of PDF documents, extracting key information and generating summaries. It's designed to streamline research, data extraction, and content understanding from unstructured PDF data.
What it does
This workflow acts as a sub-workflow, designed to be called by another n8n workflow. It performs the following key steps:
- Triggers on Workflow Execution: It starts when explicitly called by another n8n workflow, receiving input data.
- Initial Data Transformation: It processes the incoming data, likely preparing it for AI interaction.
- AI Agent for PDF Analysis: It utilizes an AI Agent (likely powered by a LangChain agent) to interact with the PDF content. This agent can:
- Call n8n Workflow Tool: Execute another n8n workflow as a tool, potentially for tasks like OCR processing (e.g., using Mistral's OCR as hinted by the directory name) or specific data retrieval.
- Basic LLM Chain: Interact with a Large Language Model (LLM) to understand, summarize, or extract information from the PDF.
- OpenRouter Chat Model: Specifically uses an OpenRouter chat model for its LLM interactions, offering flexibility in choosing powerful and cost-effective models.
- Structured Output Parser: Ensures that the AI's output is parsed into a structured format (e.g., JSON), making it easy to use in subsequent steps.
- Generates Email Summary: After the AI agent completes its analysis, the workflow composes an email using Gmail, likely containing the extracted information or a summary of the PDF.
- Merges Data: Combines the results from various processing steps.
- Splits Out Data: Potentially processes arrays or lists of data into individual items for further handling.
Prerequisites/Requirements
To use this workflow, you will need:
- n8n Instance: A running n8n instance.
- OpenRouter Account & API Key: For the
OpenRouter Chat Modelnode to access various LLMs. - Gmail Account & Credentials: Configured in n8n for sending emails.
- LangChain Integration: Ensure the
@n8n/n8n-nodes-langchainpackage is installed and configured in your n8n instance. - Sub-Workflow for OCR/PDF Handling: (Implied by the "Call n8n Workflow Tool" node and directory name) Another n8n workflow that can perform OCR (e.g., using Mistral's OCR) and extract text from PDFs, which this workflow can call as a tool.
Setup/Usage
- Import the Workflow: Download the JSON provided and import it into your n8n instance.
- Configure Credentials:
- Set up your Gmail OAuth or API credentials in n8n.
- Set up your OpenRouter API key credentials in n8n.
- Configure AI Agent:
- Open the
AI Agentnode and ensure theCall n8n Workflow Toolis correctly configured to point to your OCR/PDF processing sub-workflow. - Verify the
OpenRouter Chat Modelis using your configured OpenRouter credentials and the desired model. - Adjust the
Structured Output Parserschema if the expected output from your AI agent changes.
- Open the
- Configure Gmail Node: Update the
Gmailnode with the recipient email address, subject, and body template based on your desired output. - Activate the Workflow: Once configured, activate the workflow. It will then be ready to be called by other workflows.
This workflow is designed to be a powerful backend for automating complex PDF analysis tasks, providing structured insights from your documents.
Related Templates
Automated YouTube video uploads with 12h interval scheduling in JST
This workflow automates a batch upload of multiple videos to YouTube, spacing each upload 12 hours apart in Japan Standard Time (UTC+9) and automatically adding them to a playlist. ⚙️ Workflow Logic Manual Trigger — Starts the workflow manually. List Video Files — Uses a shell command to find all .mp4 files under the specified directory (/opt/downloads/单词卡/A1-A2). Sort and Generate Items — Sorts videos by day number (dayXX) extracted from filenames and assigns a sequential order value. Calculate Publish Schedule (+12h Interval) — Computes the next rounded JST hour plus a configurable buffer (default 30 min). Staggers each video’s scheduled time by order × 12 hours. Converts JST back to UTC for YouTube’s publishAt field. Split in Batches (1 per video) — Iterates over each video item. Read Video File — Loads the corresponding video from disk. Upload to YouTube (Scheduled) — Uploads the video privately with the computed publishAtUtc. Add to Playlist — Adds the newly uploaded video to the target playlist. 🕒 Highlights Timezone-safe: Pure UTC ↔ JST conversion avoids double-offset errors. Sequential scheduling: Ensures each upload is 12 hours apart to prevent clustering. Customizable: Change SPANHOURS, BUFFERMIN, or directory paths easily. Retry-ready: Each upload and playlist step has retry logic to handle transient errors. 💡 Typical Use Cases Multi-part educational video series (e.g., A1–A2 English learning). Regular content release cadence without manual scheduling. Automated YouTube publishing pipelines for pre-produced content. --- Author: Zane Category: Automation / YouTube / Scheduler Timezone: JST (UTC+09:00)
Monitor bank transactions with multi-channel alerts for accounting teams
Enhance financial oversight with this automated n8n workflow. Triggered every 5 minutes, it fetches real-time bank transactions via an API, enriches and transforms the data, and applies smart logic to detect critical, high, and medium priority alerts based on error conditions, amounts, or risk scores. It sends multi-channel notifications via email and Slack, logs all data to Google Sheets, and generates summary statistics for comprehensive tracking. 💰🚨 Key Features Real-time monitoring every 5 minutes for instant alerts. Smart prioritization (Critical, High, Medium) based on risk and errors. Multi-channel notifications via email and Slack. Detailed logging and summary reports in Google Sheets. How It Works Schedule Trigger: Runs every 5 minutes. Fetch Transactions: HTTP request retrieves real-time transaction data. API Error?: If condition for error logic is met, sends error alert. Enrich & Transform Data: Advanced risk calculation enhances data. Critical Alert?: If condition (50% or risk > 8) is met, raises alert. High Priority?: If condition (5% or risk > 7) is met, raises alert. Medium Priority?: If condition is met, raises alert. Log Priority to Sheet: Google Sheets appends critical, high, or medium priority data. Send Critical Email: HTML email to execute sheets append. Send High Priority Email: Email to finance team. Send High Priority Slack: Slack notification to finance team. Send Medium Priority Email: Email to finance team. Merge All Alerts: Combines all alerts for comprehensive tracking. Generate Summary Stats: Code block for analytics. Log Summary to Sheet: Summary statistics storage. Setup Instructions Import the workflow into n8n and configure the bank API credentials in "Fetch Transactions." Set up Google Sheets OAuth2 and replace the sheet ID for logging nodes. Configure Gmail API Key and Slack Bot Token for alerts. Test the workflow with sample transaction data exceeding risk or amount thresholds. Adjust priority conditions (e.g., 50%, 5%, risk > 8) based on your risk policy. Prerequisites Bank API access with real-time transaction data (e.g., https://api.bank.com) Google Sheets OAuth2 credentials Gmail API Key for email alerts Slack Bot Token (with chat:write permissions) Structured transaction data format Google Sheet Structure: Create a sheet with columns: Transaction ID Amount Date Risk Score Priority (Critical/High/Medium) Alert Sent Summary Stats Updated At Modification Options Adjust the "Schedule Trigger" interval (e.g., every 10 minutes). Modify "Critical Alert?" and "High Priority?" conditions for custom thresholds. Customize email and Slack templates with branded messaging. Integrate with fraud detection tools for enhanced risk analysis. Enhance "Generate Summary Stats" with additional metrics (e.g., average risk). Discover more workflows – Get in touch with us
Detect holiday conflicts & suggest meeting reschedules with Google Calendar and Slack
Who’s it for Remote and distributed teams that schedule across time zones and want to avoid meetings landing on public holidays—PMs, CS/AM teams, and ops leads who own cross-regional calendars. What it does / How it works The workflow checks next week’s Google Calendar events, compares event dates against public holidays for selected country codes, and produces a single Slack digest with any conflicts plus suggested alternative dates. Core steps: Workflow Configuration (Set) → Fetch Public Holidays (via a public holiday API such as Calendarific/Nager.Date) → Get Next Week Calendar Events (Google Calendar) → Detect Holiday Conflicts (compare dates) → Generate Reschedule Suggestions (find nearest business day that isn’t a holiday/weekend) → Format Slack Digest → Post Slack Digest. How to set up Open Workflow Configuration (Set) and edit: countryCodes, calendarId, slackChannel, nextWeekStart, nextWeekEnd. Connect your own Google Calendar and Slack credentials in n8n (no hardcoded keys). (Optional) Adjust the Trigger to run daily or only on Mondays. Requirements n8n (Cloud or self-hosted) Google Calendar read access to the target calendar Slack app with permission to post to the chosen channel A public-holiday API (no secrets needed for Nager.Date; Calendarific requires an API key) How to customize the workflow Time window: Change nextWeekStart/End to scan a different period. Holiday sources: Add or swap APIs; merge multiple regions. Suggestion logic: Tweak the look-ahead window or rules (e.g., skip Fridays). Output: Post per-calendar messages, DM owners, or create tentative reschedule events automatically.
