Track employee expense receipts from Telegram with GPT-4o-mini and Google Sheets
Employee sends a photo → AI extracts merchant, amount, date → policy check auto-approves or routes to manager → record results and monthly email report
- Who
- Small-team finance or ops staff who need employee expense claims with approval trails and a ledger
- You get
- Employees submit receipt photos via Telegram for automatic entry; the system auto-approves, rejects, or escalates to a manager based on Google Sheets rules, then emails a monthly summary
- You need
- n8n · telegram · google-sheets · gmail
Constraints
Requires: an n8n instance with a public URL for Telegram webhooks, a Telegram Bot Token (via @BotFather), an OpenAI API Key (gpt-4o-mini), Google Sheets API credentials, and Gmail credentials. Cost: roughly one cent per receipt for OpenAI; other services billed at platform rates.
What they did
Author vitaliy published a 41-node n8n template. Employees submit receipt photos through a Telegram bot; GPT-4o-mini Vision extracts structured fields, a Code node cleans the values, and two Merge nodes compare against Policy and Expenses tables in Google Sheets. A Switch node auto-approves compliant claims or routes exceptions to a manager via Telegram, with all outcomes written back to Sheets and employees notified. A scheduled branch emails an HTML monthly summary.
How it went
The author states the template is built for production unattended operation; the AI only reads the image, while all decisions come from the user's own sheet rules. The template page showed 7 views at time of collection. No specific ROI or verified enterprise metrics were provided.
Worth knowing
A public n8n URL is required for Telegram Approve/Reject callback buttons to resume the workflow; without it, the approval path will stall. OpenAI cost is roughly one cent per receipt. The 60-day age limit and 70% AI confidence threshold can be adjusted in the Prepare Policy Flags node. The category list must be kept consistent between the AI prompt and the Extract Expense Details code node. The author offers extended customization (mileage, per-diem, multi-currency, QuickBooks/Xero export, etc.), but these have not been verified by this site.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- After import, connect your own credentials on auth-required nodes; author secrets are not included.
Configuration to replace
- Source template is n8n public workflow #19225 (~41 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-25
Steps
Prerequisites: create spreadsheet and credentials
Create a Google Sheets workbook with two tabs: Policy and Expenses. Policy headers: Category | LimitPerReceipt | ApprovalAbove | Allowed | Notes. Expenses headers: SubmittedAt | Employee | TelegramUserId | ChatId | Merchant | Date | Amount | Currency | Tax | Category | Description | Status | Decision | DecisionNote | ReceiptFileId | Month. Configure Telegram, OpenAI, Google Sheets, and Gmail credentials in n8n. Record the manager chat ID and finance chat ID.
Trigger: receive receipt photo on Telegram
Employee sends a photo to the bot (a caption like "team lunch with client" is recommended). The Telegram Trigger node downloads the largest image size. If no photo is attached, the bot auto-replies asking for a photo.
Execution prompt · Source text。Telegram node Request Receipt Photo text field
=Please send the receipt as a photo (not as text). Add a short caption if you like, for example "team lunch with client" - the amount, date and merchant are read from the picture.
AI extraction: GPT-4o-mini reads and structures the receipt
The OpenAI node sends the image as base64 to gpt-4o-mini with a strict JSON instruction. A Code node parses the response, normalizes dates (e.g. 12.09.2026, 09/12/2026, 12 Sep 2026), amounts (1.250,00 / 1,250.00), and currency symbols, maps the category to the allowed list, and builds a duplicate key. If the call fails, the employee is asked to retry and nothing is recorded.
Execution prompt · Source text。OpenAI node AI Analyze Receipt Photo text/prompt field
You read receipts for an expense claim. Look at the image and return ONLY a JSON object with these keys: {"is_receipt": true or false, "merchant": "shop or restaurant name", "date": "YYYY-MM-DD of the purchase", "total": number (grand total actually paid, including tax and tip), "currency": "3-letter ISO code, infer from symbol or country", "tax": number (VAT / sales tax shown, 0 if none), "category": one of Meals | Travel | Transport | Accommodation | Office | Software | Other, "payment_method": "card | cash | other", "items": "short description of what was bought, max 100 characters", "confidence": 0-100} Rules: copy numbers exactly as printed; if a value is not visible use "" or 0; never guess a merchant; if the picture is not a receipt set is_receipt to false. No markdown, no explanations.Policy enforcement: deduplication, limits, and routing
Load the policy row for the receipt's category from the Policy tab, and check the Expenses tab for an identical claim. A Switch node routes: auto-approve (within limits and no approval needed), duplicate, missing info, not allowed (disabled category or over limit), or needs approval (over threshold, unknown category, older than 60 days, or AI confidence below 70%).
Resolution: record, notify, and forward to finance
All outcomes converge to one branch and are appended to the Expenses tab. The employee receives a Telegram reply with status icon and reason. Approved receipt photos are forwarded to the finance chat. Claims needing approval use Telegram sendAndWait with Approve/Reject buttons; the workflow waits up to 3 days. After manager action, status and timestamp are updated. [First-test safety] Before the first test, point Add Entry to Expenses documentId at a test sheet, or set Inform Employee of Outcome / Send Receipt to Finance / Request Manager Approval chatId to a test account, so production expense rows and real coworkers are not touched.
Monthly report: automated email on the 1st
A Schedule Trigger runs at 8 AM on the 1st of each month. It reads the previous month's approved expenses, totals per employee and per category (by currency), builds an HTML table, and emails it via Gmail. The MONTH constant in the Code node can be set manually to rebuild a past month.
Prompt you can copy
Setup guidance · Editorial suggestion。Give to setup assistant; confirm inputs and permissions first
This block is the prompt. Ads are never placed here.
You are an n8n workflow setup assistant. The user wants to replicate the "Telegram receipts → GPT-4o-mini extraction → Google Sheets approval → monthly report" automation. Assist in this order: 1) Confirm the user has an n8n instance with a public URL; 2) Verify the Google Sheets Policy/Expenses tab structure matches requirements; 3) Guide importing the workflow JSON and replacing placeholders like YOUR_SPREADSHEET_ID, YOUR_MANAGER_CHAT_ID, YOUR_FINANCE_CHAT_ID; 4) Suggest sending a test receipt to validate AI extraction and policy routing. Do not perform sensitive operations on the user's behalf.
Confirm public n8n URL and spreadsheet structure first, then import the template, replace placeholders, and test one receipt end-to-end.
Source
Track employee expense receipts from Telegram with GPT-4o-mini and Google Sheets · vitaliy · n8n.io · 2026-09-04
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.