Skip to main content

Extract invoice data from Gmail with GPT-4o and send Slack notifications

Workflow preview

Workflow preview
100%
Extract invoice data from Gmail with GPT-4o and send Slack notifications preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Who is this for? This workflow is ideal for freelancers, accountants, and finance teams who receive invoices in Gmail and want to automate their tracking process with AI. If your inbox fills up wit...

Best for

  • Content Creation automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.scheduletrigger, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.noop, n8n-nodes-base.stickynote, n8n-nodes-base.gmail, 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 Matt Chong | n8n Creator.

Original n8n.io source

1.1 Workflow description

Title
Extract invoice data from Gmail with GPT-4o and send Slack notifications
Workflow name
Extract invoice data from Gmail with GPT-4o and send Slack notifications

Who is this for?

This workflow is ideal for freelancers, accountants, and finance teams who receive invoices in Gmail and want to automate their tracking process with AI.

If your inbox fills up with invoice-related messages and you want to automate how they’re handled, this AI-powered solution is for you.

What does it solve?

  • Automatically detects and processes invoices from your Gmail inbox.
  • Uses OpenAI GPT-4o to extract payment amount, due date, subject line, and sender details.
  • Sends real-time Slack notifications so you never miss a payment.
  • Eliminates manual sorting of invoice-related emails.
  • Great for improving productivity and ensuring timely payment tracking.

How it works

  • Every hour, the workflow checks for unread emails in your Gmail inbox.
  • It sends the email content to OpenAI to determine if it's invoice-related email.
  • If it is:
    • It extracts key fields like due date, amount due, subject, and sender.
    • Then sends a Slack message with these details.
  • If it's not invoice-related, it simply ignores the email.

How to setup?

  1. Connect these accounts:

    • Gmail using OAuth2
    • Slack using OAuth2
    • OpenAI (API Key under credentials)
  2. Customize the Slack message (optional):

    • In the Slack node, you can modify the text to show more fields or personalize the formatting.
  3. Adjust the schedule:

    • By default, the workflow runs hourly. You can change the frequency in the Schedule Trigger node.
  4. Modify the AI logic (optional):

    • Update the AI Agent prompt to detect additional types like receipts or payment confirmations.

How to customize this workflow to your needs

  • Notify a Slack channel instead of a user: Just switch the recipient in the Slack node.
  • Add labels in Gmail: Add nodes to label or archive invoice emails once detected.
  • Expand detection: Modify the AI prompt to detect other financial or transactional emails.

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 - Schedule Trigger

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

Block 2 - AI Agent

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

Block 3 - OpenAI Chat Model

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

Block 4 - Structured Output Parser

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

Block 5 - No Operation, do nothing

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

Block 6 - Sticky Note2

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

Block 7 - Get Unread Emails

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

Block 8 - Check If Email is Invoice

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

Block 9 - Sticky Note1

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

Block 10 - Sticky Note

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

Block 11 - Notify Slack User

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

Block 12 - Sticky Note3

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

3. Summary Table

Workflow Extract invoice data from Gmail with GPT-4o and send Slack notifications
Complexity intermediate
Nodes 12
Categories Content Creation, Multimodal AI
Author Matt Chong | n8n Creator
Published 22 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7735/7735.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 Extract invoice data from Gmail with GPT-4o and send Slack notifications do?

Who is this for? This workflow is ideal for freelancers, accountants, and finance teams who receive invoices in Gmail and want to automate their tracking process with AI. If your inbox fills up wit...

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 Content Creation, Multimodal AI use case.