What you’ll learn: The technical architecture behind multi-custodian reconciliation: how a pluggable adapter pattern normalises data from five different banks into one view, and how an agent flags the exceptions that matter.
The five-column-name problem
A fund administrator managing a multi-custodian portfolio receives end-of-day files from each custodian. HSBC calls the column “Trade Date.” UBS calls it “Transaction Date.” Julius Baer calls it “Date.” Morgan Stanley uses “Traded.” One file uses DD/MM/YYYY. Another uses YYYY-MM-DD. A third uses a serial date number.
A human reconciler reads each file and translates mentally, every single day. This is not analysis. It is format conversion performed by a person earning HKD 25,000 per month.
The core problem is not the data. The data exists, and it is complete. The problem is that every custodian expresses the same information differently, and no one has built the translation layer.
The pluggable adapter pattern
An automated reconciliation pipeline using n8n implements one adapter per custodian. Each adapter is a small, standalone module that knows how to read that custodian’s specific file format and map it to the firm’s internal schema.
When a new custodian is added, you build one adapter. You do not touch the rest of the pipeline. The adapter handles:
- Column name mapping (Transaction Date → tradeDate)
- Date format conversion (DD/MM/YYYY → ISO 8601)
- Asset identifier normalisation (ISIN, SEDOL, Bloomberg ticker → internal ID)
- Currency standardisation (HKD, HK$, Hong Kong Dollar → HKD)
The pipeline receives files from five custodians, runs each through its adapter, and outputs a single normalised data set.
The reconciliation process shifts from "read five files and merge manually" to "review exceptions in one unified view." The daily reconciliation that took a senior analyst 3-4 hours now takes 20-30 minutes of exception review.
How the pipeline triggers
The pipeline starts when a custodian file lands. The trigger can be:
- An email attachment (n8n monitors the firm’s secure inbox)
- An SFTP drop (the custodian pushes the file to a shared folder)
- A webhook (the custodian’s API notifies n8n that the file is ready)
- A manual upload (the user drags the file into a web portal)
n8n checks for files every 15 minutes during the reconciliation window. As soon as all expected files for the day are received, the pipeline begins.
The agent reviews exceptions
After n8n normalises and merges the data, an agent layer (the OpenClaw concept) runs exception detection:
- Missing positions: A position appears in the HSBC file but not in the UBS file for the same client
- Price variances: The same holding is priced differently across two custodians (common with illiquid assets)
- Corporate actions: A dividend or stock split was applied by one custodian but not another
- FX discrepancies: The FX rate used for a cross-currency trade differs from the expected rate
Each exception is assigned a severity level. Critical exceptions (missing positions, large price variances) are escalated immediately. Routine exceptions (minor FX differences) are queued for the next business day.
The analyst reviews the exception list. Each exception includes the raw data from both custodians, the expected value, and the agent’s assessment of the likely cause. The analyst either confirms the exception and triggers a query to the custodian, or clears it and adjusts the expected value.
The audit trail
Every file received, every transformation applied, and every exception detected is logged with a timestamp. If a client questions a position value three months later, the firm can trace back to the exact custodian file, the adapter version that processed it, and the analyst who cleared the exception.
This audit trail is itself a compliance asset. The SFC and HKMA both expect firms to demonstrate that their reconciliation process is controlled and verifiable. A manual process does not produce an audit trail automatically. An automated one does.
Frequently Asked Questions
The adapter for that custodian fails, and the pipeline alerts the team. The analyst can still access the raw file and process it manually while the adapter is updated. The update typically takes a few hours: one adapter, one change, no impact on the other custodians.
The system flags corporate actions for human review. If a dividend was paid and one custodian's file reflects it while another does not, the exception is surfaced. The analyst confirms the action and the expected impact. Over time, the agent learns the firm's handling rules for common corporate actions and can apply them with reduced human oversight.
The architecture supports any number. Each adapter is independent. A firm with three custodians uses three adapters. A firm with 15 uses 15. The pipeline performance does not degrade with volume because the adapters run in parallel.