Turn forwarded business document images into structured records with gpt-5.6-terra Vision, Postgres, and Gmail
Ready for 3.0What 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).
- Normalize submission (Edit Fields (Set)): sets 8 fields: doc_id, source, received_at…
- Find open documents from yesterday or earlier (Postgres): run a query
- Has an image attached (If): checks a condition and branches into true / false
- Are there open documents (If): checks a condition and branches into true / false
- Build GPT-4o vision request (Code): runs custom JavaScript code
- Email unrecognized notice to operations (Gmail): uses Gmail
- Build follow-up summary (Code): runs custom JavaScript code
- Build all-clear note (Code): runs custom JavaScript code
- Call GPT-4o vision (HTTP Request): calls api.openai.com (POST)
- Email follow-up to operations (Gmail): uses Gmail
…plus 5 more steps. See the full node list below.
Services it uses
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)
- Webhook
n8n-nodes-base.webhook - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - Postgres
n8n-nodes-base.postgres - Gmail
n8n-nodes-base.gmail - Schedule Trigger
n8n-nodes-base.scheduleTrigger - HTTP Request
n8n-nodes-base.httpRequest
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.…