Automated Invoice Data Extraction and Conditional Notification - n8n Workflow

Use this robust n8n workflow to automatically scan new emails for invoices, extract total amounts using Mindee AI, and send conditional Slack and email notifications.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Finance and Accounts Payable (AP) departments.
Users looking for advanced n8n templates integrating AI document processing.
Teams needing conditional logic within their financial n8n workflow automation.


  • Developers seeking examples of using the n8n node ecosystem for email parsing.

Overview

This comprehensive n8n workflow template solves the significant operational challenge of manually monitoring incoming emails for critical financial documents like invoices. By leveraging a specialized n8n node for IMAP reading combined with Mindee for accurate Optical Character Recognition (OCR) data extraction, this automation ensures that critical invoices are immediately flagged and processed.

The key value of this specific n8n workflow is its built-in conditional logic. It automatically escalates high-value invoices (over 1000) to management via a separate internal email alert, while notifying the general accounts team via Slack for all detected invoices. This demonstrates the power of custom application development using an interconnected n8n node sequence to create efficient, error-reducing n8n templates.

How it Works

This n8n workflow operates through a structured sequence of checks and actions:


  1. Email Polling: The Check for new emails n8n node uses IMAP credentials (e.g., Gmail) to periodically scan the specified mailbox, acting as the primary n8n trigger for the flow.

  2. Initial Filtering: An If n8n node (If email body contains invoice) checks if the email body text contains the word 'invoice' (case-insensitive).

  3. Data Extraction: If the filter passes, the Extract the total amount n8n node utilizes the Mindee service to analyze the first attachment (attachment_0). This AI-powered n8n node accurately extracts structured data, including the invoice total amount.

  4. Value Condition: A second If n8n node (If Amount > 1000) evaluates the extracted amount. This crucial piece of n8n logic dictates the subsequent path.

  5. High-Value Alert: If the amount is greater than 1000 (true branch), an emailSend n8n node triggers, sending a dedicated notification email to the specified [email protected] address, ensuring rapid approval processes.

  6. Team Notification: The flow concludes by using the Send new invoice notification Slack n8n node. This node sends a rich, structured notification to the #team-accounts channel, providing all critical metadata (subject, sender, date, and extracted amount), streamlining team awareness regardless of whether the high-value condition was met.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import: Copy the entire JSON code and import it into your n8n instance via the 'New' menu -> 'Import from JSON'. This is a ready-to-use component for your n8n templates collection.

  2. IMAP/Gmail Credentials: Configure the Check for new emails n8n node with your appropriate IMAP or Gmail credentials.

  3. Mindee Credentials: Set up a Mindee API connection (Invoice API key) and link it to the Extract the total amount n8n node.

  4. SMTP Credentials: Configure the Send email to finance manager n8n node with valid SMTP credentials (like Mailtrap, as indicated in the template) to handle outgoing email alerts.

  5. Slack Credentials: Connect your Slack workspace using an appropriate Access Token credential to the Send new invoice notification n8n node.

  6. Customization: Adjust the target Slack channel name, the finance manager's email address, and the threshold value (currently 1000) within the If n8n node based on your internal policies.

  7. Activation: Set the n8n workflow to 'Active' to allow it to run on a set schedule (usually paired with a Cron n8n trigger).

Node Details

Check for new emails (emailReadImap n8n node)
Function: Acts as the polling n8n trigger, checking the Inbox for new emails using GMAIL credentials.
Key Configuration: Uses the resolved format and allows unauthorized certificates for flexible server connectivity.
If email body contains invoice (If n8n node)
Function: A core logic step that filters emails, ensuring the text content (converted to lowercase) contains the string "invoice".
Extract the total amount (Mindee n8n node)
Function: Performs OCR on the attached document (binaryPropertyName: attachment0) to accurately extract structured data specific to invoices.
If Amount > 1000 (If n8n node)
Function: Implements conditional routing based on numerical data, checking if the extracted totalincl amount is numerically larger than 1000.
Send email to finance manager (emailSend n8n node)
Function: Sends a specialized email alert for high-value invoices (over 1000), using attachment_0 to forward the original invoice.
Send new invoice notification (Slack n8n node)
* Function: The final action, sending a formatted notification to the #team-accounts channel. It dynamically pulls data (Amount, From, Subject, Date) from upstream n8n node outputs to create a rich notification.

Related n8n Workflows

Free

Nodes: 5 Nodes
Updated: December 26 2025
View all
Created by
Jonathan
Jonathan

Featured*