Reconcile bank payments to invoices and ERP using Postgres and Claude

Quick overview This workflow reconciles incoming bank transactions against open invoices and existing ERP payment records, optionally escalating borderline matches to Anthropic Claude for review, persisting results in Postgres, and notifying a finance team via Slack while returning a run summary to webhook callers.

How it works Starts a reconciliation run via a manual trigger, a daily 06:00 schedule, or a POST webhook request. Ensures the required Postgres tables exist and loads previously reconciled bank transaction and invoice IDs to make the run idempotent. Fetches open invoices and ERP payments from an ERP API and bank transactions from a bank API, then normalizes all three datasets into a consistent schema. Validates that all source API calls succeeded, then runs a rules-based matching engine to score and classify matches and generate exceptions (for example unmatched payments, overdue invoices, duplicates, and ERP conflicts). Sends borderline matches to Anthropic Claude for approve/reject/escalate decisions and applies those decisions with confidence and variance guardrails. Upserts matches, exceptions, and run summaries into Postgres, optionally posts auto-matched payments back to the ERP API with an idempotency key, and sends a Slack webhook alert only when items need review or exceptions exist. Returns the final reconciliation summary as JSON to the webhook caller or logs the run as failed in Postgres and responds with HTTP 502 if any source API fails.

Setup Add a Postgres credential and ensure the database user can create tables and read/write the reconciliation_runs, reconciliation_matches, and reconciliation_exceptions tables. Update the source API URLs, query parameters, field mappings, and authorization headers for your ERP and bank systems in the configuration code. Add your Anthropic API key (and optionally disable AI review) by updating the Claude settings in the configuration code. (Optional) Create a Slack incoming webhook and set its URL in the configuration code to receive alerts when attention is needed. (Optional) Enable ERP write-back and set the ERP apply-payments endpoint and credentials after validating results in dry runs.

0
Downloads
0
Views
8.31
Quality Score
beginner
Complexity
Author:Oneclick AI Squad(View Original →)
Created:10/25/2026
Updated:10/25/2026

🔒 Please log in to import templates to n8n and favorite templates

Workflow Visualization

Loading...

Preparing workflow renderer

Comments (0)

Login to post comments