Skip to main content

Process invoices and send weekly AI reports with OpenAI and Gmail

Workflow preview

Workflow preview
100%
Process invoices and send weekly AI reports with OpenAI and Gmail preview
Open on n8n.io

1. Workflow Overview

Overview This workflow automates invoice handling from upload to reporting using AI. Users submit invoices through a simple form. The workflow extracts key details, validates the data, stores valid...

Best for

  • Invoice Processing automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.formtrigger, n8n-nodes-base.set, n8n-nodes-base.datatable, n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.code, n8n-nodes-base.if

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by ResilNext.

Original n8n.io source

1.1 Workflow description

Title
Process invoices and send weekly AI reports with OpenAI and Gmail
Workflow name
Process invoices and send weekly AI reports with OpenAI and Gmail

Overview

This workflow automates invoice handling from upload to reporting using AI.

Users submit invoices through a simple form. The workflow extracts key details, validates the data, stores valid invoices, and sends email notifications. It also generates a weekly summary report automatically.

This helps reduce manual data entry and ensures consistent invoice processing.


How It Works

  1. Form Submission Users upload an invoice (PDF or image) along with their email.

  2. Initial Storage The raw submission is stored for tracking and reference.

  3. Text Extraction The uploaded file is processed to extract text content.

  4. AI Data Extraction AI converts the raw text into structured invoice data such as invoice number, vendor, date, currency, and totals.

  5. Validation The workflow checks:

  • Date format (YYYY-MM-DD)
  • Allowed currencies
  • Total amount validity
  1. Conditional Flow
  • If valid → invoice is stored and a success email is sent
  • If invalid → an error email is sent with details
  1. Weekly Reporting A scheduled trigger runs weekly to:
  • Fetch all validated invoices
  • Generate a summary report using AI
  • Send the report via email

Setup Instructions

  1. Add your OpenAI credentials (used for data extraction and reporting)
  2. Connect Gmail credentials for sending emails
  3. Configure Data Tables:
  • invoice_form_submissions
  • validated_invoices
  1. Update the Workflow Configuration node:
  • Set report recipient email
  • Adjust allowed currencies if needed
  1. Ensure the file field (invoiceFile) is correctly mapped
  2. Test with a sample invoice
  3. Activate the workflow

Use Cases

  • Automating invoice processing for small businesses
  • Reducing manual accounting data entry
  • Validating invoices before storing them
  • Generating weekly financial summaries
  • Handling invoice submissions from clients or teams

Requirements

  • OpenAI API credentials
  • Gmail account (for sending emails)
  • n8n Data Tables (or replace with your preferred database)
  • n8n instance with file upload support

Notes

  • Make sure to fix the IF condition: Use {{$json.validation.isValid}} instead of accessing isValid directly.

  • You can extend validation rules in the Code node based on your business needs.

  • The reporting section can be customized to include more insights or formats.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Invoice Upload Form

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.3

Block 2 - Workflow Configuration

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Store Raw Form Submission

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 4 - Extract Invoice Content

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1.1

Block 5 - Extract Invoice Data with AI

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 6 - Invoice Data Schema Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 7 - Validate Invoice Data

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - Check Validation Result

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.3

Block 9 - Prepare Success Email Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Store Validated Invoice

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 11 - Send Success Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 12 - Prepare Error Email Data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 13 - Send Error Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 14 - Weekly Report Schedule

Type / Role
n8n-nodes-base.scheduleTrigger - scheduleTrigger
Config choices
Version 1.3

Block 15 - Fetch Weekly Invoices

Type / Role
n8n-nodes-base.dataTable - dataTable
Config choices
Version 1

Block 16 - Generate Weekly Report

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 17 - Send Weekly Report Email

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.2

Block 18 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 19 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 21 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 22 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note6

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 30 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Process invoices and send weekly AI reports with OpenAI and Gmail
Complexity advanced
Nodes 30
Categories Invoice Processing, AI Summarization
Author ResilNext
Published 23 Mar 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/14269/14269.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Process invoices and send weekly AI reports with OpenAI and Gmail do?

Overview This workflow automates invoice handling from upload to reporting using AI. Users submit invoices through a simple form. The workflow extracts key details, validates the data, stores valid...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, AI Summarization use case.