Daily payment reconciliation with the partner file
The partner's D-1 file, with about 400,000 rows, arrives in S3 by 6 a.m. and triggers reconciliation. Step Functions processes the file in batches of 5,000 rows against Aurora; each mismatch becomes a message in the analyst's queue. Measured average duration: 11 minutes.
External
AWS Cloud
Ingestion
Reconciliation
Settlement partner
D-1 CSV file
S3 input
parceiro/ prefix
EventBridge
Object Created rule
Step Functions
Distributed Map per batch
Reconciliation Lambda
compares each batch
Aurora PostgreSQL
ledger pagamentos table
SQS mismatches
DLQ after 3 failures
Reconciliation analyst
internal console
1
2
3
4
5
6
7
8
Steps
1
The settlement partner writes liquidacao_AAAAMMDD.csv to the input bucket, under the prefix parceiro/, by 6 a.m.
2
S3 emits the event Object Created to EventBridge.
3
The rule filters the prefix and starts Step Functions; the file name is the idempotency key.
4
The Distributed Map state splits the file into batches of 5,000 rows and calls the Reconciliation Lambda for each batch.
5
The Lambda reads its batch directly from S3.
6
Each row is compared with the table pagamentos in Aurora by transaction ID: amount, settlement date and status.
7
Each mismatch becomes a message in the SQS queue; amounts above BRL 10,000 receive priority.
8
The reconciliation analyst processes the queue in the internal console by 9 a.m.