# Extract invoice data from Telegram PDFs and upload to SAP with approval
This automation template helps accountants and finance operators process incoming invoices quickly and accurately. Simply send a PDF invoice via Telegram — the system extracts data using OCR and AI, presents it for confirmation, then uploads it to SAP Business One and logs it in Google Sheets.
## Who it´s for
- Accountants processing incoming invoices in SAP.
- Finance operators using Telegram to upload documents.
- Companies on SAP Business One automating invoice intake.
- Document archives integrated with Google Sheets.
## What the automation does
- On receiving a PDF invoice via Telegram, triggers LlamaIndex OCR to extract text.
- Uses GPT-4o-mini to parse extracted text into structured JSON: supplier, line items, totals, VAT.
- Sends structured data back to user in Telegram with ´Yes/No´ confirmation buttons.
- On approval, creates a PurchaseInvoice document in SAP via REST API.
- Stores all invoice details in Google Sheets for audit and reporting.
- Handles async processing: if OCR status is PENDING, workflow pauses and retries until ready.
## What´s included
- Ready-to-use n8n workflow.
- Logic for handling Telegram messages and callback queries.
- Integrations with Telegram, SAP Business One, Google Sheets, OpenAI, and LlamaIndex AI.
- Basic setup and adaptation guide.
## Requirements for setup
- n8n instance with external API access.
- Telegram bot with token and configured webhook.
- SAP Business One REST API access credentials.
- Google Sheets file with Google Drive API enabled.
- OpenAI and LlamaIndex API keys (if self-hosted or external).
## Benefits and outcomes
- Reduces invoice processing time from minutes to seconds post-approval.
- Eliminates manual data entry errors in SAP.
- Centralized logging of all invoices in Google Sheets.
- Transparent workflow with user confirmation before SAP upload.
- Scalable: one bot can serve multiple users.
- Handles complex PDFs via advanced LlamaIndex-based OCR.
## Important: template only
Important: you are purchasing a ready-made automation workflow template only. Rollout into your infrastructure, connecting specific accounts and services, 1:1 setup help, custom adjustments for non-standard stacks and any consulting support are provided as a separate paid service at an individual rate. To discuss custom work or 1:1 help, contact via chat
No feedback yet