Automated Invoice Processing with Telegram, GPT-4o, OCR and SAP Integration
    100%
    Automation
    0(0 reviews)
    1287 downloads

    Automated Invoice Processing with Telegram, GPT-4o, OCR and SAP Integration

    NM

    Curated by n8n Markets team

    Last updated: March 8, 2026

    ++HOW IT WORKS:++ This workflow automates the processing of invoices sent via Telegram. It extracts the data using LlamaIndex OCR, logs it in Google Sheets, and optionally pushes the structured data to SAP Business One 🔹 1. Receive Invoice via Telegram: A user sends a PDF of an invoice through Telegram A Telegram Trigger node listens for incoming messages and captures the file and metadata The document is downloaded and prepared for OCR 🔹 2. OCR with LlamaIndex: The file is uploaded to the LlamaIndex OCR API. The workflow polls the API until the processing status returns SUCCESS Once ready, the parsed content is fetched in Markdown format 🔹 3. Data Extraction via LLM (editable): The Markdown content is sent to a language model (LLM) using LangChain A Structured Output Parser transforms the result into a clean, structured editable JSON 🔹 4. Save to Google Sheets: The structured JSON is split into: Header (main invoice metadata) Detail (individual line items) Each part is stored in a dedicated tab within a connected Google Sheets file 🔹 5. Ask for SAP Confirmation: The bot replies to the user via Telegram: "Do you want to send the data to SAP?" If the user clicks "Yes", the next automation path is triggered. 🔹 6. Push Data to SAP B1: A connection is made to SAP Business One's Service Layer API Header and detail data are fetched from Google Sheets The invoice structure is rebuilt as required by SAP (DocumentLines, CardCode, etc.) A POST request creates the Purchase Invoice in SAP A confirmation message with the created DocEntry is sent back to the user on Telegram ++SET UP STEPS:++ Follow these steps to properly configure the workflow before execution: 1️⃣ Create Required Credentials: Go to Credentials > + New Credential and create the following: Telegram API (set your bot token get it from BotFather) Google Sheets OpenAI 2️⃣ Set Up Environment Variables (Optional but Recommended): LLAMAINDEX_API_KEY SAP_USER SAP_PASSWORD SAP_COMPANY_DB SAP_URL 3️⃣ Prepare Google Sheets: Ensure your Google Spreadsheet has the following: ➤ Sheet 1: Header ➤ Sheet 2: Details Contains columns for invoice lines

    What's Included

    • Complete n8n workflow template with 0 nodes. Ready to import and customize.

    Requirements

    n8n instance (self-hosted or cloud). credentials.

    How to Use

    1. Download the workflow JSON 2. Import into your n8n instance 3. Configure credentials for 4. Activate and enjoy automation

    How to import this template into n8n

    1. Download the workflow JSON file from this page.
    2. In n8n, open Workflows, create a new workflow and choose Import from File.
    3. Open each node that shows a warning and connect your own credentials.
    4. Run the workflow once manually to check the output before you activate it.
    Included in Pro
    • Importable n8n workflow JSON file
    • Download with Builder Pro or Agency Unlimited
    • Built for n8n v1.0++
    • Setup time: 30-60 min

    Included in Builder Pro — $19/mo, 4,177 premium workflows

    Before you activate

    Templates are reviewed before they are listed. Test with your own credentials and data before running it in production.

    Updated Mar 2026
    v1.0
    SSL
    Secure
    GDPR

    100% Secure Checkout

    Refund requests within 7 days of a new subscription

    Dependencies & Requirements

    Google Sheets
    Data

    ⚠️ 1 service require credentials. Make sure you have accounts set up before importing.

    Reviews

    0

    No reviews yet

    See all 0 reviews ↓
    —

    0 reviews

    5★
    0
    4★
    0
    3★
    0
    2★
    0
    1★
    0

    No reviews yet.

    Questions & Answers

    0

    Log in to ask a question.

    No questions yet. Be the first to ask!

    People Also Bought