🧾 Automate travel expense extraction with OCR, Mistral AI and Supabase

238 views · 🧾 Invoice Processing

Description

Travel Reimbursement - OCR & Expense Extraction Workflow

Overview

This is a lightweight n8n workflow that accepts chat input and uploaded receipts, runs OCR, stores parsed results in Supabase, and uses an AI agent to extract structured travel expense data and compute totals. Designed for zero retention operation and fast integration.


Workflow Structure


Chat Trigger (Frontend)

Binary Presence Check

Binary Normalization

OCR

Store OCR Output

Memory & Tooling

Travel Reimbursement Agent (Core)

Data Flow Summary

  1. User sends chat message plus or minus file.
  2. IF file present -> Split Out -> Normalize -> OCR -> Store OCR output -> Merge with chat payload.
  3. Travel reimbursement agent consumes merged item, extracts fields, uses Calculator tool for sums, and replies with a formatted expense summary.

Integrations Used

ServicePurposeCredential
Mistral CloudLLM for agentMistral account
SupabaseStore parsed OCR blocks and session dataSupabase account
OCR APIText extraction from images/PDFsConfigurable HTTP endpoint
n8n CoreFlow control, parsing, editingNative

Agent System Prompt Summary

> You are a Travel Expense Extraction and Calculation AI. Extract vendor, dates, currency, category, and total amounts from uploaded receipts, invoices, hotel bills, PDFs, and images. Infer values when necessary and mark them as estimated. When asked, fetch session entries from Supabase and compute totals using the Calculator tool. Respond in a concise business professional format with a category wise breakdown and a Grand Total. Never reply “unclear” or ask for a reupload unless explicitly asked.

Required final response format example:


Key Features


Setup Checklist

  1. Add Mistral Cloud and Supabase credentials.
  2. Configure OCR endpoint to accept multipart uploads and return blocks.
  3. Create temp_table schema with session_id, file, file_name.
  4. Test with single receipts, multipage PDFs, and mixed uploads.
  5. Validate agent responses and Calculator totals.

Summary

A practical n8n workflow for travel expense automation: accept receipts, run OCR, store parsed data per session, extract structured fields via an AI agent, compute totals, and return clean expense summaries in chat. Built for reliability and easy integration.


Need Help or More Workflows?

We can integrate this into your environment, tune the agent prompt, or adapt it for different OCR providers.

We can help you set it up for free — from connecting credentials to deploying it live.

Contact: rajeet.nair@digitalbiz.tech
Website: https://www.digitalbiz.tech
LinkedIn: https://www.linkedin.com/company/digital-biz-tech/
You can also DM us on LinkedIn for any help.

🔗 Nodes Used

HTTP Request, Supabase, AI Agent, Simple Memory, Calculator, Mistral Cloud Chat Model

📥 Import

Download workflow.json and import into n8n: Workflow menu → Import from File

📖 Importing guide · 🔑 Credential setup