{"product_id":"n8n-webhook-gpt-4o-vision-to-postgres-document-records","title":"n8n Webhook: GPT-4o Vision to Postgres Document Records","description":"\u003ch3\u003eTurn document photos into structured records automatically—via an n8n Webhook\u003c\/h3\u003e\n\u003cp\u003eThis n8n workflow receives business document images through a webhook, uses \u003cstrong\u003eOpenAI GPT-4o Vision\u003c\/strong\u003e to classify and extract key fields, then \u003cstrong\u003eupserts the results into Postgres\u003c\/strong\u003e and emails an operations summary (or an “unreadable document” alert) via Gmail. A daily reminder keeps anything still marked \u003cem\u003eopen\u003c\/em\u003e from slipping through.\u003c\/p\u003e\n\n\u003ch3\u003eWhat this workflow does\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eWebhook intake:\u003c\/strong\u003e Accepts a \u003ccode\u003ePOST\u003c\/code\u003e submission containing an \u003cstrong\u003eimage URL or base64 image\u003c\/strong\u003e, plus optional metadata such as document type and a sender note.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eValidation \u0026amp; analysis:\u003c\/strong\u003e Verifies an image is present, then sends it to \u003cstrong\u003eOpenAI GPT-4o Vision\u003c\/strong\u003e with instructions to return a \u003cstrong\u003estructured JSON record\u003c\/strong\u003e and a summary.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNormalization:\u003c\/strong\u003e Parses the AI response into normalized fields including document type, title, summary, extracted data, amount, currency, dates, and a confidence score.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003ePostgres persistence:\u003c\/strong\u003e If recognized, the workflow \u003cstrong\u003eupserts\u003c\/strong\u003e the structured record into the \u003cstrong\u003ePostgres\u003c\/strong\u003e \u003ccode\u003ebiz_documents\u003c\/code\u003e table (using a unique \u003ccode\u003edoc_id\u003c\/code\u003e).\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eOperations notifications:\u003c\/strong\u003e Emails the extracted summary to the operations inbox via \u003cstrong\u003eGmail\u003c\/strong\u003e. If the document is missing or unrecognized, it emails an “unreadable document” notice.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDaily follow-up:\u003c\/strong\u003e Runs at \u003cstrong\u003e08:00 (Asia\/Jakarta)\u003c\/strong\u003e, queries Postgres for documents not marked \u003ccode\u003edone\u003c\/code\u003e and older than 24 hours, and sends a follow-up list to operations via Gmail.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eUse cases\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003eAutomated receipt\/invoice capture from email forwards or internal tools using an \u003cstrong\u003en8n webhook\u003c\/strong\u003e.\u003c\/li\u003e\n  \u003cli\u003eBack-office document intake: extract amounts, currencies, and dates into \u003cstrong\u003ePostgres\u003c\/strong\u003e for reporting.\u003c\/li\u003e\n  \u003cli\u003eOperational visibility: immediate summary emails plus a daily reminder for any documents still open.\u003c\/li\u003e\n\u003c\/ul\u003e\n\n\u003ch3\u003eTechnical details\u003c\/h3\u003e\n\u003cul\u003e\n  \u003cli\u003e\n\u003cstrong\u003eNodes\/blocks:\u003c\/strong\u003e \u003ccode\u003ewebhook\u003c\/code\u003e, \u003ccode\u003eif\u003c\/code\u003e, \u003ccode\u003eset\u003c\/code\u003e, \u003ccode\u003ecode\u003c\/code\u003e, \u003ccode\u003egmail\u003c\/code\u003e, \u003ccode\u003epostgres\u003c\/code\u003e\n\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eAI:\u003c\/strong\u003e OpenAI Chat Completions with the \u003cstrong\u003egpt-4o\u003c\/strong\u003e model for Vision-based JSON extraction.\u003c\/li\u003e\n  \u003cli\u003e\n\u003cstrong\u003eDatabase:\u003c\/strong\u003e Postgres \u003ccode\u003ebiz_documents\u003c\/code\u003e table with fields used by the INSERT\/UPSERT logic.\u003c\/li\u003e\n\u003c\/ul\u003e","brand":"N8N Commerce","offers":[{"title":"Default Title","offer_id":45950050009267,"sku":"N8N-19167","price":29.99,"currency_code":"GBP","in_stock":true}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0749\/6279\/6723\/files\/kfEG62rL-RAgT-WDB6QAq_tmBBBTjs.png?v=1788513079","url":"https:\/\/buyflowscripts.com\/products\/n8n-webhook-gpt-4o-vision-to-postgres-document-records","provider":"N8N Commerce","version":"1.0","type":"link"}