Serverless Invoice Pipeline

Serverless AWS event-driven pipeline generating and delivering automated monthly invoices.

Serverless Invoice Pipeline media
Production infrastructure diagrams are kept confidential. The image above is an illustrative reference sourced from AWS Architecture Blog (© Amazon Web Services).
  • AWS CDK
  • TypeScript
  • AWS Lambda
  • SQS
  • EventBridge
  • Secrets Manager
  • Node.js
  • React
  • Postmark
  • CloudWatch

Serverless, event-driven invoice delivery system built entirely from scratch on AWS. Automates the monthly generation and delivery of thousands of restaurant invoice emails - triggering from ETL completion, fetching invoices from a REST API, generating React-based PDF documents, and delivering templated emails via Postmark.

Highlights

  1. Designed and built the complete 3-Lambda event-driven pipeline from scratch: ETL completion event → dynamic EventBridge schedule creation → SQS batch dispatch → PDF generation + templated email delivery.
  2. Dynamic EventBridge Scheduler creation at runtime - each ETL cycle programmatically creates a one-shot 1st-of-month schedule that self-deletes after execution, eliminating persistent cron configuration and over-triggering risk.
  3. Invoice PDF generation using @react-pdf/renderer - React-component-based invoice document with multi-section payment breakdowns (Domestic, International, Wallet, Prior Adjustments) per provider (Stripe/Adyen), rendered server-side to base64.
  4. SQS-based batch fanout - paginated invoice fetch from REST API batched into SQS (10/batch), processed 5 at a time per Lambda invocation with dead-letter queue, retry policy, and per-message batch failure reporting.
  5. Production-grade CDK stack: VPC-isolated Lambdas, Secrets Manager for all API credentials, CloudWatch error and throttle alarms wired to Slack SNS notifications, and per-environment resource namespacing across QA, staging, and production.
  6. Postmark templated email delivery with PDF attachment - base64-encoded invoice attached per message, secrets fetched at runtime from Secrets Manager, with multi-environment secret path conventions and fallback env var support.

Last updated: 2026-06-06