Mahindra Lifespace Developers wanted to remove manual clerical review from its Accounts Payable pipeline. Wohlig built an AI validation engine on Google Cloud that checks each vendor invoice before it is posted in SAP. Clean invoices post straight through, and only genuine exceptions reach a person. The engine is live, processing 50–60 invoices per day, and passed a third-party VAPT assessment before go-live.
Project Overview
Vendor invoices arrive through the enterprise document-workflow platform, which extracts structured data and hands each invoice to the validation engine. Wohlig built the engine as a multi-agent pipeline on one Google Cloud AI stack. It runs as five independently scaled Cloud Run services and processes 50–60 invoices per day in production.
The Challenge
Manual, repetitive review: each invoice took a clerk 10–12 minutes to check GST, TDS, PO matching, vendor details, duplicates and totals.
Heterogeneous invoices: PO and non-PO invoices, several tax scenarios (CGST/SGST/IGST) and varied vendor formats, all in one workflow.
Compliance-grade accuracy: GST and TDS are statutory, so the engine had to be conservative and auditable.
Non-disruptive integration: the AI had to fit the existing workflow-to-SAP flow without changing how the business works.
Explainability: finance needs to know why an invoice failed, with a defensible trail for every automated decision.
Enterprise security: the platform had to pass a third-party VAPT assessment before go-live.
Key Objectives
Automate the AP checklist: GST, TDS/WHT, three-way match, master data, duplicates and math.
Straight-through processing: clean invoices post directly, with human review for exceptions and low-confidence cases.
Data-driven rules: business-governable rules that change without a code deployment, under an approval workflow.
Secure integration: JWT-authenticated ingest, an exact verdict-callback contract and idempotency.
Explainable decisions: per-rule outcomes, confidence and full agent traces.
Predictable cost: per-invoice cost tracking.
The Solution
The engine runs as five Cloud Run services: a webhook receiver (auth, ingestion, idempotency and de-duplication), a dispatcher, the ADK agent that runs the validation pipeline, a notifier (verdict callback and Slack alerts) and an admin console for rules and prompts. Supporting services include Pub/Sub, BigQuery, Firestore, Cloud Storage, Cloud Tasks and Secret Manager.
Each invoice passes through six agents in order: reference-data fetch, AI extraction, extraction cross-check, rule validation, persistence and result publication.
AI extraction: a multimodal model reads each invoice PDF and returns structured fields against a per-document-type JSON schema, including buyer name, GSTIN and state. Prompts and schemas are versioned, and a capped reasoning budget keeps cost predictable.
Dual-source cross-check: the AI output is compared with the existing document-extraction output through a tolerance-aware comparator, before the business rules run.
Data-driven rule engine: rules live as data in BigQuery: 23 for PO invoices, 18 for non-PO invoices, plus tax-invoice rules. Changes go through an approval workflow with full history.
Secure, idempotent integration: the workflow platform authenticates with short-lived JWT Bearer tokens. Firestore de-duplicates submissions by transaction number, so retries are safe.
Key Benefits & Results
Processing speed
Previous: 10–12 min per invoice, by hand.
Our solution: multi-agent validation engine on Cloud Run.
Result: about 30 seconds per invoice, roughly 20× faster.
Unit cost
Previous: clerk time for every invoice.
Our solution: capped reasoning budget and per-invoice cost tracking.
Result: about $0.0035 per invoice, tracked per run.
Rules
Previous: checklist applied by hand.
Our solution: rules held as data in BigQuery, with an approval workflow.
Result: 41+ configurable validation rules, changed without a code release.
Accuracy
Previous: inconsistent review at scale.
Our solution: dual-source extraction cross-check and confidence scoring.
Result: about 82% rule-level pass rate and 96% average confidence.
Throughput
Previous: manual queue.
Our solution: five independently scaled Cloud Run services.
Result: 50–60 invoices per day in production.
Security
Previous: no third-party assessment.
Our solution: security hardening and VAPT remediation.
Result: passed the VAPT assessment and was cleared before go-live.
Technical Innovation
Agent-based pipeline: specialised agents make each verdict traceable step by step.
Rules as data, with governance: entity-scoped rules change through an approval workflow and deploy without a code release.
Dual-source verification: AI extraction is checked against the existing extraction output before the rules run.
Per-invoice cost governance: a capped reasoning budget and per-invoice cost tracking.
Idempotent, event-driven ingestion: JWT-authenticated webhook ingest, Firestore de-duplication and Pub/Sub decoupling.
Entity-aware validation: buyer name, GSTIN and state are matched against entity master data.
Wohlig’s Approach
Discovery and workflow mapping: mapped the workflow to SAP AP, the manual checklist and every invoice scenario.
Rule-engine design: turned the AP checklist into 41+ data-driven, entity-scoped rules in BigQuery.
AI extraction and prompt engineering: per-document-type JSON schemas and versioned prompts with capped reasoning budgets.
Agent pipeline orchestration: composed the multi-agent chain on Google Cloud’s agent framework, with full tracing per invoice.
Secure workflow integration: JWT-authenticated ingest, the exact verdict-callback contract and idempotent retries.
Governance and audit layer: rule approval, per-rule outcomes, confidence scoring and agent traces.
Security hardening and VAPT remediation: closed the assessment findings and passed VAPT before go-live.
Deployment and cutover: five Cloud Run services live in production, processing 50–60 invoices every day.
Where It Stands
Live in production, processing 50–60 invoices per day, and cleared before go-live after the VAPT assessment.
About Mahindra Lifespace Developers Ltd (MLDL)
The real-estate and integrated-cities business of the Mahindra Group. Its finance function processes high volumes of vendor invoices, where accuracy, statutory compliance and efficiency are business-critical.
About Wohlig Transformations Pvt. Ltd.
Founded in 2015. Specialises in GenAI and DevOps, with 160+ professionals across India and the UK. AI agents that ship, not slideware.
Detailed Case Study Video: Detail Video
Detailed Case Study Presentation: Presentation


