# Match vendor invoices to PO and GRN with OpenAI, Gmail, Sheets and Slack

> Quick overview This workflow ingests vendor invoices from Gmail, uses OpenAI to extract invoice fields, matches invoices against Purchase Orders and GRNs stored in Google Sheets, and routes approvals via Slack, while archiving files to Google Drive and generating a weekly bank-upload CSV payment batch. How it works 1. Triggers hourly when Gmail receives an email with attachments under the invoices label that is not yet marked processed. 2. Splits PDF/image attachments, uploads each invoice file to Google Drive, and sends the document to OpenAI to extract structured invoice data (vendor, GSTINs, PO, line items, and taxes). 3. Loads vendor master data, purchase orders, GRNs, and the existing AP ledger from Google Sheets and performs 3-way matching with GST/TDS validation and duplicate detection. 4. Writes the evaluated invoice (status, exceptions/warnings, approval token, and Drive link) back to the AP Ledger tab in Google Sheets. 5. Posts a Slack FYI for auto-approved invoices, sends a 

- **Domain**: `n8n-workflow-21074.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/21074
- Page (HTML): https://agenstry.com/agents/n8n-workflow-21074.n8n.io
- Documentation: https://n8n.io/workflows/21074
