Skip to main content

GPT-4.1-mini Powered Invoice Processing from Gmail to Google Sheets with Slack

Workflow preview

Workflow preview
100%
GPT-4.1-mini Powered Invoice Processing from Gmail to Google Sheets with Slack preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

AI Powered Invoice Processing from Gmail to Google Sheets with Slack Approval This workflow completely automates your invoice processing pipeline. It triggers when a new invoice email arrives in Gm...

Best for

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

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.gmail, n8n-nodes-base.extractfromfile, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.webhook, n8n-nodes-base.slack

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
GPT-4.1-mini Powered Invoice Processing from Gmail to Google Sheets with Slack
Workflow name
GPT-4.1-mini Powered Invoice Processing from Gmail to Google Sheets with Slack

AI-Powered Invoice Processing from Gmail to Google Sheets with Slack Approval This workflow completely automates your invoice processing pipeline. It triggers when a new invoice email arrives in Gmail, uses AI to extract key data from the PDF attachment, logs it in a Google Sheet, and sends a request to Slack with simple links for one-click approval or rejection. Who's it for? This template is perfect for small business owners, finance teams, freelancers, and anyone looking to eliminate the manual work of processing invoices. It saves hours of data entry, reduces human error, and streamlines the approval process. How it works Trigger: The workflow starts when an email with a specific subject (e.g., "Invoice") arrives in Gmail. Extraction: It automatically downloads the first PDF attachment from the email and extracts all its text content. AI Processing: The extracted text is sent to an AI model, which intelligently identifies and pulls out key details: invoice number, issue date, company name, total amount, and due date. Logging: This structured data is appended as a new row in your Google Sheet. The status is automatically set to "pending". The full, raw text from the PDF is also saved for easy verification. Approval Request: A formatted message is sent to a designated Slack channel. This message includes the key invoice details and two unique links: one to approve and one to reject the invoice. Handle Response: When a user clicks either the "Approve" or "Reject" link, the corresponding Webhook in the workflow is triggered. Update Sheet: The workflow finds the correct row in the Google Sheet using the invoice number and updates its status to "approved" or "rejected". Confirmation: A final confirmation message is sent to the Slack channel, closing the loop and informing the team of the action taken. How to set up Credentials: Add your credentials for Gmail, OpenAI, Google Sheets, and Slack in the designated nodes. Gmail Trigger: In the "1. New Invoice Email Received" node, change the search query q from "incoice" to the keyword you use for invoice emails (e.g., "invoice"). Google Sheets: In the three Google Sheets nodes ("6. Log Invoice...", "9a. Update Status to Approved", and "9b. Update Status to Rejected"), enter your Google Sheet ID and the name of the sheet. Slack: In the three Slack nodes ("7. Send Approval Request...", "10a. Send Approval Confirmation", and "10b. Send Rejection Confirmation"), enter your Slack Channel ID. Webhook URLs: First, activate the workflow using the toggle in the top-right corner. Open the "Webhook (Approve)" node, go to the Production URL tab, and copy the URL. Paste this URL into the "7. Send Approval Request to Slack" node, replacing the https://YOUR_WEBHOOK_BASE_URL/webhook/approval part of the approval link. Repeat this process for the "Webhook (Reject)" node and the rejection link. Activate Workflow: Ensure the workflow is active for the Webhooks to work continuously. How to customize AI Prompt: You can modify the prompt in the "5. Extract Invoice Data with AI" node to extract different or additional fields to match your specific invoice formats. Slack Messages: Feel free to customize the text in all three Slack nodes to better fit your team's tone and communication style.

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 - 1. New Invoice Email Received

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

Block 2 - 2. Get Email Attachments

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

Block 3 - 3. Extract Text from PDF

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

Block 4 - 4. Prepare Text for AI

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

Block 5 - 5. Extract Invoice Data with AI

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

Block 6 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 7 - Webhook (Approve)

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 8 - Webhook (Reject)

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 9 - 10a. Send Approval Confirmation

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

Block 10 - 10b. Send Rejection Confirmation

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

Block 11 - 6. Log Invoice to Google Sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 12 - Structured Output Parser

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

Block 13 - 9a. Update Status to Approved

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 14 - 9b. Update Status to Rejected

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 15 - 7. Send Approval Request to Slack

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

Block 16 - 8a. Extract Invoice ID

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

Block 17 - 8b. Extract Invoice ID

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

Block 18 - GPT-4.1-mini Powered Invoice Processing

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

Block 19 - Sticky Note

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

Block 20 - Sticky Note1

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

Block 21 - Sticky Note2

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

3. Summary Table

Workflow GPT-4.1-mini Powered Invoice Processing from Gmail to Google Sheets with Slack
Complexity advanced
Nodes 23
Categories Invoice Processing, AI Summarization
Author koichi nagino
Published 16 Nov 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10874/10874.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 GPT-4.1-mini Powered Invoice Processing from Gmail to Google Sheets with Slack do?

AI Powered Invoice Processing from Gmail to Google Sheets with Slack Approval This workflow completely automates your invoice processing pipeline. It triggers when a new invoice email arrives in Gm...

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.