Report scheduling and delivery infrastructure handles the operational reliability of automated reporting -- ensuring reports arrive on time, to the right recipients, with delivery confirmation, and without silent failures.
Scheduling: AWS EventBridge Scheduler or GCP Cloud Scheduler for cron-triggered report runs (daily, weekly, monthly, or custom cron expression). Business-event-triggered reports (month-end close completion, new client onboarded, contract milestone reached) use webhook or queue-based triggers: a Salesforce workflow triggers a webhook to the reporting API when a deal closes, initiating the new client's first report; a month-end close event from the ERP triggers the monthly board pack run. Dependency-aware scheduling: the board pack run depends on the data warehouse ETL completing first -- the scheduler waits for an ETL completion signal (via SNS notification or a completion status record in the reports.job_status table) before starting report generation.
Email delivery: SendGrid v3 or AWS SES for email delivery; individual send per recipient (not BCC) so bounce tracking, open tracking, and unsubscribe handling work per recipient. Email contains a brief summary line from the report and a secure download link (pre-signed S3 URL with 7-day expiry) rather than attaching the PDF directly -- avoids spam filter issues with large attachments and allows access tracking. Slack delivery: Slack Incoming Webhook or Slack API files.upload for reports configured for Slack delivery to a channel.
Delivery confirmation logging: every delivery event (report_id, recipient_email, delivery_timestamp, SendGrid message_id) stored in the report_delivery_log table. SendGrid Event Webhook sends bounce, complaint, and delivery events back to the reporting API and updates the delivery status record. A delivery report showing sent/bounced/opened status per report and recipient is available in the admin interface.
Retry logic and failure handling: transient delivery failures (SMTP timeout, Slack rate limit) trigger automatic retry with exponential backoff (2 minutes, 8 minutes, 32 minutes, max 3 retries). Permanent failures (invalid email, Slack channel not found) log an alert to the report owner without retrying. Cronitor or Healthchecks.io job monitoring: each scheduled report run sends a heartbeat on completion; if no heartbeat arrives within 20 minutes of the expected run time, an alert fires to the #reporting-ops Slack channel.