How to build a Refund/Expense Approval AI Agent
This agent automates the extraction, validation, and approval/denial of employee reimbursement requests.
Challenge
Manual review of employee reimbursement receipts is slow, error-prone, and requires cross-referencing multiple sources for policy compliance.
Industry
Finance
Operations
Department
HR
Integrations
OpenAI
Knowledge Base
Workflow Overview
1. User Provides Input
Text Input (in-0):
The user selects or enters the category of their expense (e.g., travel, meals).
2. Receipt Upload and OCR Extraction
Receipt (doc-0):
The user uploads a receipt (PDF, image, or scan).
This node uses OCR to extract all text and data from the receipt, making it machine-readable.
3. AI Extraction of Invoice Data
OpenAI (llm-0):
This AI node takes the extracted receipt text and the user’s input.
It pulls out structured information such as:CPF (tax ID)
Date of request
Invoice payer email
Employee global ID
Employer name
Reimbursement reference month
Ticket link
Total amount requested
Travel type
The output is a structured summary of all relevant invoice data.
Output (out-0):
Displays the results from the first OpenAI node (llm-0) to the user.
4. Retrieve Company Policy from Google Drive
Get File (action-0):
This node retrieves a file from Google Drive using the file ID produced by the previous AI extraction.It fetches the file’s metadata, content, and can parse the file into text for further analysis.
In this workflow, it is used to pull up the relevant company reimbursement policy or employee cost limit document.
Output (out-1):
Shows the results of the file retrieval (e.g., the policy document or its parsed content).
5. AI Decision: Refund Approval or Denial
OpenAI 1 (llm-1):
This AI node takes:The extracted receipt data,
The user’s input,
And the company policy document from Google Drive.
It compares the total cost on the receipt to the employee’s reimbursement limit and decides if the refund is allowed.
The AI provides a clear explanation for approval or denial, referencing both the receipt and the policy.
Output 2 (out-2):
Shows the final decision to the user—whether the refund is approved or denied, with an explanation.
Visual Summary
Node Name | Purpose/Action |
|---|---|
Text Input | User selects/enters expense category |
Receipt | User uploads receipt; OCR extracts text |
OpenAI (llm-0) | AI extracts structured invoice data from receipt and user input |
Output (out-0) | Shows extracted invoice data |
Get File (action-0) | Retrieves company policy from Google Drive using file ID from AI extraction |
Output (out-1) | Shows retrieved policy or parsed content |
OpenAI 1 (llm-1) | AI compares receipt data to policy, decides on refund, and explains reasoning |
Output 2 (out-2) | Shows final approval/denial and explanation |
How the Data Flows
User Input → Receipt Upload
Receipt OCR → AI Extraction (llm-0)
AI Output → Google Drive File Retrieval (action-0)
Policy Document + Receipt Data → AI Decision (llm-1)
Final Output: User sees if their refund is approved or denied, with a clear explanation.
In summary:
This workflow automates the process of reviewing employee reimbursement requests by extracting data from receipts, retrieving relevant company policy documents, and using AI to make and explain approval decisions—all in a seamless, auditable flow.





