π¬ AI-powered accounting reports from Sabre EDI with GPT-4 and Pinecone RAG
β‘ 2,249 views Β· π¬ Document Extraction & Analysis
Description
This workflow automates the process of reading EDI files generated by Sabre, parsing them using an AI Agent, and producing structured accounting reports like:
π Accounts Receivable (AR) Summary π Tax and Surcharges Report
It also uses Retrieval-Augmented Generation (RAG) to vectorize the Sabre Interface User Record (IUR)βa 154-page technical documentβso that the AI agent can reference it when clarification is required while generating reports.
βοΈ Tools & Integrations Used Component:Tool/Service:Purpose:Workflow Engine:n8n:Automation & orchestration LLM Model:OpenAI GPT-4 / Chat Model:Natural language understanding and parsing Embeddings Model:OpenAI Embeddings:Convert text into semantic vector format Vector Database:Pinecone:Store and retrieve document chunks semantically Storage:Google Drive:Source of raw EDI text files and PDF documentation DataLoader + Splitter:n8n Node + Recursive Splitter:Loads and prepares documents for embedding AI Agents:n8n AI Agent Node:Runs context-aware prompts and parses reports
π§± Workflow Breakdown π§ 1. Vectorizing the Sabre IUR Document (RAG Setup) π Objective: Enable the AI Agent to refer to the IUR document (154 pages) for detailed explanations of EDI terms, formats, and rules.
Flow Steps:
Google Drive Search + Download β Find and pull the IUR PDF file.
Default Data Loader β Load the file and preprocess it for semantic splitting.
Recursive Character Splitter β Break down large pages into meaningful chunks.
OpenAI Embeddings β Vectorize each chunk.
Pinecone Vector Store β Save into a Pinecone namespace for future retrieval.
β Result: The IUR is now searchable via semantic queries from the AI Agent.
π 2. Reading and Extracting Data from EDI Files π Objective: Parse raw EDI files for financial records and summaries.
Flow Steps:
Trigger β Manual or scheduled execution of the workflow.
Google Drive Search β Finds all new .edi or .txt files.
Download File Contents β Loads content of each file into memory.
Extract from File β Raw text extraction.
π 3. Report Generation Using AI Agents π Objective: AI Agents parse the extracted data to generate structured accounting reports.
a. Accounts Receivable Report Agent The extracted text is passed to an AI Agent.
Model is connected to:
OpenAI Chat Model (LLM)
Pinecone Vector DB (IUR reference)
Outputs a structured AR Summary Report.
b. Tax and Surcharges Report Agent Same steps as above.
Prompts adjusted to extract tax, fees, surcharges, and amounts.
β Output Format: Can be mapped to columns and inserted into a Google Sheet or exported as a CSV/JSON.
π Sample Reports You Can Build Already implemented:
β Accounts Receivable (AR) Summary Report
β Tax and Surcharges Report
Can be extended to: 3. Accounts Payable (AP) 4. Passenger Revenue 5. Daily Sales 6. Commission Report 7. Net Profit Margin (if supplier cost + commission is available)
π‘ Key Advantages β No-code automation with n8n
β Semantic reasoning using AI + Vector DB (RAG)
β Can work with various Sabre outputs without manual parsing
β Modular: Easy to add new report types
β Cloud-integrated (Drive, Pinecone, OpenAI)
π§ͺ Potential Improvements Area Suggestions Testing Add a βPreviewβ step to validate extracted data before writing Scalability Batch mode + Google Sheet batching for multiple reports Audit Trail Log every file name, timestamp, report type in a Google Sheet Notification Send Slack/Email when a new report is generated Multi-model support Add Claude/Gemini fallback if OpenAI usage limit is hit
π Nodes Used
Google Drive, AI Agent, Embeddings OpenAI, OpenAI Chat Model, Recursive Character Text Splitter, Pinecone Vector Store
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File