Templates / Invoice processing: Email to PostgreSQL database with GPT-4o & Discord alerts

Invoice processing: Email to PostgreSQL database with GPT-4o & Discord alerts

Ready for 3.0

by Halfbit 🚀 ✓ · 681 views · created 2025-07-28 · Invoice Processing, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 23 nodes and runs when a new email arrives over IMAP. Along the way it connects Discord, OpenAI Chat Model and Postgres.

How it runs

Trigger: When a new email arrives over IMAP.

  1. If: checks a condition and branches into true / false
  2. Code: runs custom JavaScript code
  3. If: checks a condition and branches into true / false
  4. Extract from File: extracts data from a file (pdf)
  5. Basic LLM Chain: sends a prompt to an LLM, with model: OpenAI Chat Model; output parser: Structured Output Parser
  6. Merge: merges the data from its input branches
  7. If: checks a condition and branches into true / false
  8. Discord: uses Discord
  9. Prepare Company Data (Edit Fields (Set)): sets or maps fields
  10. Check Company (Postgres): run a query

…plus 10 more steps. See the full node list below.

Services it uses

DiscordOpenAI Chat ModelPostgres

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Nodes used (11)

From the author

AI-Powered Invoice Processing: from Email to Database & Chat Notifications Automatically process PDF invoices directly from your email inbox. This workflow uses AI to extract key data, saves it to a PostgreSQL database, and instantly notifies you about the…

Excerpt from Halfbit 🚀's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.