Templates / Turn forwarded business document images into structured records with gpt-5.6-terra Vision, Postgres, and Gmail

Turn forwarded business document images into structured records with gpt-5.6-terra Vision, Postgres, and Gmail

Ready for 3.0

by Khairul Muhtadin ✓ · 17 views · created 2026-09-04 · Document Extraction, 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 workflow has 17 nodes and runs when an HTTP POST request hits its webhook URL (plus 1 other trigger). Along the way it connects Postgres and Gmail. It also calls api.openai.com over HTTP.

How it runs

Trigger: When an HTTP POST request hits its webhook URL (plus 1 other trigger).

  1. Normalize submission (Edit Fields (Set)): sets 8 fields: doc_id, source, received_at…
  2. Find open documents from yesterday or earlier (Postgres): run a query
  3. Has an image attached (If): checks a condition and branches into true / false
  4. Are there open documents (If): checks a condition and branches into true / false
  5. Build GPT-4o vision request (Code): runs custom JavaScript code
  6. Email unrecognized notice to operations (Gmail): uses Gmail
  7. Build follow-up summary (Code): runs custom JavaScript code
  8. Build all-clear note (Code): runs custom JavaScript code
  9. Call GPT-4o vision (HTTP Request): calls api.openai.com (POST)
  10. Email follow-up to operations (Gmail): uses Gmail

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

Services it uses

PostgresGmail

HTTP calls to: api.openai.com

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 (8)

From the author

Forwarded documents, handled. This workflow takes business document photos sent to a webhook, reads them with AI vision, stores structured records in Postgres, and emails your ops team a summary. Unreadable files get flagged, open items get daily reminders.…

Excerpt from Khairul Muhtadin'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.