Weekly customer usage brief from your DynamoDB events
Every Monday at 8am, roll up last week's events from DynamoDB, spotlight top movers, at-risk accounts, and silent customers, and email it to you.
Every Monday at 8am, read the last seven days of usage events from my DynamoDB events table and email me a plain-English customer-usage brief.
At setup, ask me three things about the events table: its name, the attribute name that holds the customer id, and the attribute name that holds the event timestamp (plus whether that timestamp is a Unix epoch number or an ISO 8601 string). Also ask which Gmail account should receive the brief and what my timezone is.
Trigger: cron, every Monday at 08:00 in my timezone.
Step 1. Use Amazon DynamoDB to pull last week's rows. Prefer Query with a KeyConditionExpression on the timestamp if the table's partition/sort-key layout supports it; otherwise Scan with a FilterExpression on the timestamp attribute. Paginate through LastEvaluatedKey (pass it back as ExclusiveStartKey) until there is no more LastEvaluatedKey — do not stop after the first page. Then repeat the same read for the previous seven-day window so we can compare week over week.
Step 2. Group the current week's rows by customer id and count events per customer. Do the same for the prior week.
Step 3. From those two grouped counts, derive three lists: Top movers = the five customers with the highest event counts this week; At risk = any customer whose event count dropped more than 25% versus the prior week (skip customers with fewer than 5 events last week so we don't cry wolf on tiny denominators); Silent this week = any customer who had events last week but zero events this week.
Step 4. Draft a plain-English report with three sections in this order: 'Top movers', 'At risk', 'Silent this week'. Name specific customers with their event counts (e.g. 'Acme Corp — 142 events, up from 96 last week'). Keep the whole thing to one screen: a one-line intro, three tight sections, and one short 'so what' sentence per section that tells me what to actually do (e.g. 'Book a check-in call with these accounts this week — they were healthy last week and just fell off a cliff'). If a section has no entries, keep the heading and say so briefly ('No customers went silent this week.') rather than dropping the section. Round percentages to whole numbers.
Step 5. Send the report to me via Gmail (Send a Message) with a subject line like 'Customer usage brief — week of <Monday's date>'. Body should be plain text or lightly formatted; no attachments.
Nuance: do not dump the full customer list — only the top five movers plus every account that hits an at-risk or silent criterion. The whole point is that I can read it in under a minute and know which accounts to reach out to.
Additional information
What does this prompt do?
- Reads the last seven days of usage events from your DynamoDB events table every Monday morning.
- Groups the events by customer id and picks out your top five most active accounts of the week.
- Flags any customer whose activity dropped more than 25% versus the prior week, and anyone who went silent entirely.
- Emails you a one-screen brief with a short 'so what' line per section so you know exactly what to do next.
What do I need to use this?
- An AWS account with an IAM key that can read your DynamoDB events table (read-only is fine).
- The table name, the attribute you use for the customer id, and the attribute you use for the event timestamp.
- A Gmail account to receive the weekly brief.
How can I customize it?
- Change the delivery time or day (defaults to Mondays at 8am) and the recipient email address.
- Adjust the 'at risk' threshold (default 25% week-over-week drop) or the size of the top-movers list (default 5).
- Point it at a different events table or narrow the read to a specific product line before grouping.
Frequently asked questions
Does my events table need a specific schema?
Will this touch or change any of my data?
What if my events table is huge?
Can I send the brief to more than one person?
Can I get the brief in Slack instead of email?
Related templates
Turn your usage events into a Monday morning brief.
Stop scanning your events table by hand every week. Get the customers who matter surfaced for you before your first coffee.