2025 - Present Built
B2Pago
@ PrevalentWare · Financial sector client

n8n-based automation for biweekly commission settlement. Implements 60+ business rules including the full Colombian tax stack (Art. 383 progressive table, ICA withholding, VAT, VAT withholding, social security) and a hold/release scheme for payments that don't cover the social-security threshold. Backed by a Bun + Hono + TypeScript service running on AWS Lambda with infrastructure as code (CDK).
Features:
- 60+ business rules orchestrated in n8n covering the full Colombian tax stack: Art. 383 progressive table (7 UVT brackets), ICA withholding, VAT, VAT withholding and social security with IBC computation (40% of monthly accrual, SMMLV floor, 25-SMMLV cap)
- Hold/release scheme: when a commission doesn't cover the social-security contribution, the gross amount is held untouched (no withholdings applied) and later released either intra-month —pooled with the next commission— or end-of-month —as a synthetic record at the start of the next month—
- Progressive recalculation of Art. 383 income tax withholding and social security over the monthly accrual, retaining only the differential vs prior payments; proportional distribution by gross and by net contribution to the pool during intra-month release
- Technical workarounds for n8n limitations: pre-loop strategy for monthly accruals (SQL nodes do not share INSERT visibility within the loop) and use of $getWorkflowStaticData('global') as a mutable state bus across iterations
- Robust input validation with canonical normalization (case/accent/whitespace insensitive), rejection of spurious Excel values (NaN, #N/A, #REF!, #VALUE!) and cross-field validation across tax regime × VAT × billing responsibility
- Supporting backend in Bun + Hono + TypeScript deployed to AWS Lambda; infrastructure as code in CDK multi-stack setup (network, dev, test, prod, CI/CD)
- Persistence on SQL Server (RDS) with Prisma + MSSQL adapter, authorization via Casbin (RBAC), authentication with Better-Auth + Cognito, file storage on S3 and secrets in Secrets Manager
- Idempotent UPSERT of the commissioners master, generation of consolidated and exception XLSX reports, and SharePoint integration for source-file ingestion and output delivery
Technologies
- n8n
- TypeScript
- AWS
- SQL Server
- Prisma