See llms.txt for all machine-readable content.

Back to Templates

Match Japanese bank transfers to invoices with Gemini, Google Sheets and Slack

Quick overview

This workflow lets you upload a Japanese bank deposit CSV, matches credit transfers to open invoices in Google Sheets using kana normalization and rule-based logic, asks Google Gemini for suggestions on remaining deposits, then logs results back to Sheets and posts a reconciliation summary to Slack.

How it works

  1. Receives a bank deposit CSV upload via an n8n Form and reads it using the configured encoding.
  2. Parses the CSV to detect date, amount, and payer columns, keeps credit (deposit) rows only, and stops with an error if no deposit rows are found.
  3. Loads the existing Deposit log from Google Sheets and skips any deposits whose generated deposit ID already exists.
  4. Loads open invoices from Google Sheets, normalizes payer names (including half-width kana conversion and legal-entity marker stripping), and matches deposits to invoices using reference numbers, exact amounts, fee-deducted amounts, or combinations of invoices.
  5. Updates matched invoices in Google Sheets as paid and posts a Slack alert if any sheet update fails.
  6. For unmatched deposits with viable candidates, sends the deposit details and a shortlist of invoices to Google Gemini and keeps only suggestions that meet the configured confidence threshold.
  7. Appends every processed deposit result to the Deposit log in Google Sheets and posts a single summary message to a Slack channel listing auto-matches, Gemini suggestions to confirm, and unmatched deposits.

Setup

  1. Create a Google Sheet with an Invoices tab and a Deposit log tab using the columns expected by the workflow (including invoice_id, payer_kana, amount, status, and deposit_id).
  2. Add Google Sheets credentials, a Google Gemini (Google AI/Gemini) credential for the Gemini chat model, and a Slack credential.
  3. Update the configuration values in the workflow (Invoices sheet URL, Deposit log sheet URL, Slack channel ID, CSV encoding, fee limit, open status values, and the minimum Gemini confidence threshold).
  4. Export your bank deposit statement as a CSV (Shift_JIS or UTF-8) and upload it through the form trigger URL.