Reconcile and diagnose discrepancies between two CSV exports with Gemini

Go to Workflow
0 views
Built by Oka Hironobu Oka Hironobu
Created on August 13, 2026

Description

Quick Overview
This workflow collects two CSV exports via an n8n form, reconciles them by a user-specified key and amount column, and uses Google Gemini to diagnose likely systemic causes of any drift, returning either a “balances” confirmation or a downloadable Excel reconciliation workbook.

How it works
Receives an n8n form submission where the user describes the reconciliation, specifies the linking and amount columns, and uploads two CSV files.
Extracts both CSV files into structured rows and compares the datasets by the chosen key column to identify matches, mismatches, and missing records.
Groups results into four buckets (agrees, values disagree, only in the source of truth, only in your records) and calculates counts, totals, and the net gap.
Sends the reconciliation summary and representative examples to Google Gemini and parses the response into a structured diagnosis with likely causes, checks, and materiality.
If everything balances, returns a completion page confirming there are no differences.
If differences exist, builds an Excel workbook that starts with the diagnosis and then lists every differing row by bucket, and returns it as a download from the form.

Setup
Add a Google Gemini (PaLM) API credential for the language model used to generate the drift diagnosis.
Open the form trigger and copy the production form URL if you want to share it with teammates.
Export both systems as CSV files with a header row, and ensure both contain the linking column and the amount column you enter in the form.

Nodes Used (4)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured