See llms.txt for all machine-readable content.

Back to Templates

Create Japanese Zengin bulk transfer files from Google Sheets with Gmail

Quick overview

This workflow collects unpaid payment rows from Google Sheets for a selected batch, validates and normalizes them for the Japanese Zengin (全銀協) format, generates a Shift_JIS fixed-length transfer file, uploads it to Google Drive, and emails either a validation report or an approval summary via Gmail.

How it works

  1. Starts when you submit an n8n form with a Batch ID, transfer date, and optional expected total.
  2. Reads all rows from the Payments tab in Google Sheets and keeps only rows in the chosen batch whose status is not exported or paid.
  3. Normalizes each row to Zengin-safe text (half-width kana and allowed characters), restores leading zeros in codes, validates required fields, flags duplicates, and checks weekend/past dates and the optional expected-total control.
  4. If any validation fails, sends a single Gmail message listing all problems and stops without creating a file.
  5. If validation passes, builds a Zengin bulk transfer text file (120-character header/data/trailer/end records) and converts it into a downloadable file payload.
  6. Uploads the file to a specified Google Drive folder, emails the approver a Gmail summary with a Drive link and payment preview, and updates the matching Google Sheets rows to status exported with the file name and timestamp.

Setup

  1. Create a Google Sheets tab named Payments with the columns listed in the Overview sticky note (batch, payee details, amount, status and export columns).
  2. Add Google Sheets, Google Drive, and Gmail credentials in n8n.
  3. In the configuration step, set your Google Spreadsheet ID, the Drive output folder ID, the approver email address, and all remitter/bank details (client code, kana name, bank/branch codes, account type, account number, transfer type, and optional line ending behavior).

Requirements

  • Google Sheets with a Payments sheet (column headers are listed in the Overview sticky note)
  • Google Drive folder for the generated transfer files
  • Gmail account to send the approval and error emails
  • Your company's Zengin remitter details from your bank (client code, bank, branch and account)

Customization

  • Set the transfer type in Set configuration (7 = general transfer, 1 = salary, 2 = bonus)
  • Change the line ending (CRLF or LF) to match what your bank's upload screen expects
  • Add your own checks in the Validate and normalise payments Code node, such as an amount limit per payee
  • Replace the Gmail nodes with Slack or Microsoft Teams to notify the approver