Schedule icon
Write icon
Queries icon
If icon
Log icon
SlackIncomingWebhook icon

Pre-Check Vendor Bank Payouts Before They Reach the Bank

Validate NEFT, RTGS and IMPS payout batches before upload. Catch bad IFSCs, duplicate payments, changed vendor bank details and transfer limit errors.

Categories
BusinessData

A rejected line in a bulk payment file delays the whole vendor payment run, a payment uploaded twice is hard to get back, and a vendor whose bank account was "updated" by email is the most common way businesses get defrauded. This blueprint checks a payout batch before anyone uploads it to the bank: it validates every IFSC and account number, enforces NEFT, RTGS and IMPS limits, finds duplicate payments, and compares each payee's bank details with the approved vendor master. Only clean payments go into the upload file. Everything runs locally in DuckDB: no bank credentials, no paid API, and no account numbers leaving your Kestra instance.

How it works

  1. sample_payout_batch and sample_vendor_master (io.kestra.plugin.core.storage.Write) write a 14-payment batch with one example of every problem, and the approved vendor bank details. They are used only when the matching input is empty, so the flow runs out of the box.

  2. check_payouts (io.kestra.plugin.jdbc.duckdb.Queries) loads both CSV files through inputFiles, normalises IFSC codes, account numbers and modes, and blocks a payment when:

    • the IFSC is not 4 letters + 0 + 6 letters or digits, or the account number is not 9 to 18 digits;
    • the amount is not a positive number with at most 2 decimals, or the mode is not NEFT, RTGS or IMPS;
    • an RTGS payment is below rtgs_minimum or an IMPS payment is above imps_maximum;
    • the same account, IFSC and amount already appear earlier in the batch (paid twice);
    • the vendor is not in the vendor master, or the account or IFSC differs from the vendor master;
    • the account belongs to a different vendor in the vendor master;
    • the beneficiary name is empty.

    A beneficiary name that differs from the vendor master name is a warning. The per-payment report and the bank upload file are written with outputFiles, and the final SELECT returns the summary through fetchType: FETCH_ONE, available as outputs.check_payouts.outputs[0].row.

  3. route_findings (io.kestra.plugin.core.flow.If) logs every blocked payment when there is at least one, and a nested If posts the same findings to Slack when notify_slack is true. A clean batch is logged as well.

  4. The errors block logs a failed check loudly and says not to upload the batch, because a check that silently does not run must not look like a clean batch.

  5. The weekly_payment_run Schedule trigger (Friday 10:00 IST, shipped disabled) checks the batch before the weekly vendor payment run.

What you get

  • outputs.payout_report: CSV with payment_id, vendor_id, beneficiary_name, account_number, ifsc, amount, mode, status (ERROR, WARNING or OK), issues and notes, errors first.
  • outputs.bank_upload: the payments that passed, with payment_id, beneficiary_name, account_number, ifsc, amount and mode, ready to map to your bank's bulk upload format.
  • outputs.check_summary: JSON with total_payments, total_amount, ready_count, ready_amount, blocked_count, blocked_amount, warning_count, error_details and warning_details.
  • With the sample data: 9 blocked payments (RTGS below Rs 2 lakh, IMPS above Rs 5 lakh, a payment repeated, bank details that differ from the vendor master, an account number with a letter, a malformed IFSC, an unknown vendor, a zero amount, and an account that belongs to another vendor), 1 warning (beneficiary name differs from the master) and 4 clean payments, including an IFSC typed in lower case with spaces that is normalised and an account number whose leading zeros are kept.

Who it's for

  • Accounts payable and treasury teams in India that pay vendors through bulk NEFT, RTGS or IMPS uploads.
  • Finance operations teams that want a maker-checker step before a payout file reaches net banking.
  • Platforms that pay sellers, drivers or partners in bulk and need to stop bad lines before the bank rejects them.

Why orchestrate this with Kestra

A spreadsheet macro can check one file once. Kestra runs the same check before every payment run, keeps every batch's report in the execution history as an audit trail, branches on the result, and alerts the people who can fix the vendor records. Because the inputs are plain files, the same flow can be triggered when the batch is exported from your ERP to S3, SFTP or Google Drive, or followed by an approval step before the file is sent to the bank.

Prerequisites

  • Nothing for the demo: the sample batch and vendor master are built in.
  • For your own data: a CSV export of the payout batch and of the approved vendor bank details, with the columns listed below.

Inputs

  • payout_batch (FILE, optional): payment_id, vendor_id, beneficiary_name, account_number, ifsc, amount (in rupees) and mode (NEFT, RTGS or IMPS).
  • vendor_master (FILE, optional): vendor_id, vendor_name, account_number and ifsc.
  • rtgs_minimum (FLOAT, default 200000): smallest RTGS amount your bank accepts.
  • imps_maximum (FLOAT, default 500000): largest IMPS amount your bank accepts.
  • notify_slack (BOOL, default false): post the findings to Slack when at least one payment is blocked.

Secrets

  • SLACK_WEBHOOK_URL: Slack incoming webhook URL. Only needed when notify_slack is true.

Quick start

  1. Save the flow and run it with the default inputs.
  2. Open the logs of log_blocked and download payout_report and bank_upload from the Outputs tab.
  3. Run it again with your own payout batch and vendor master.
  4. Optional: add the SLACK_WEBHOOK_URL secret and set notify_slack to true.
  5. Point the inputs at your real sources and set disabled: false on weekly_payment_run.

Common pitfalls

  • These checks prove an IFSC is well formed, not that the branch exists or the account is open. Pair them with your bank's penny-drop or name-match verification when onboarding a vendor.
  • Keep account numbers as text when exporting from a spreadsheet, otherwise leading zeros are dropped and the bank details look changed.
  • RTGS and IMPS limits differ between banks and change over time; set rtgs_minimum and imps_maximum to what your bank allows.
  • A change of bank details is blocked on purpose. Confirm it with the vendor on a known phone number, then update the vendor master, never the payout file.

How to extend

  • Read the batch and the vendor master straight from your ERP or warehouse (Postgres, MySQL, BigQuery, Snowflake) instead of files.
  • Add a Pause or approval step after a clean check so a second person releases the payment run.
  • Convert bank_upload into your bank's bulk upload layout and deliver it over SFTP.
  • Open one ticket per blocked payment in Jira or ServiceNow with a ForEach.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.