Weekly at-risk customer re-engagement from MySQL to Gmail and HubSpot
Every Monday at 8am, find paid users who are quietly slipping away in your product database, send a personal re-engagement email, and file a CSM follow-up task.
Every Monday at 8am, sweep my MySQL product database for at-risk paid customers and run a re-engagement pass across Gmail and HubSpot. The trigger is a weekly cron.
Step 1. Pull the at-risk cohort with mysql.Custom Query. Return paid-plan users on active accounts where at least one of these is true: (a) last_login_at is 14 or more days ago, (b) last_key_action is 14 or more days ago, or (c) rolling 7-day usage has dropped materially versus the same user's 30-day baseline (target a drop of 50% or more, but expose the threshold as an easy knob). Select the fields I will need to personalize: user id, name, email, plan tier, last_login_at, last_key_action (with a short label of what the action was if available), 7-day and 30-day usage counts, account id, and the account owner or CSM email. Exclude anyone whose most recent re-engagement email is within the last 30 days, tracked either by a last_reengaged_at column on the users table or by a small outreach log table like reengagement_log(user_id, sent_at) that this workflow can also insert into. If neither exists, create the log table on first run. Cap the cohort at a sane batch size (default 25) so a bad rule never blasts the whole book, and order by most-recently-active-then-quiet so the highest-signal accounts come first.
Step 2. For each user in the cohort, use gmail.Send a Message to send a personalized re-engagement email from my Gmail. The email should reference what they last did (using last_key_action or last_login_at), how long it has been in plain language, and one concrete next step tied to their plan tier. Keep the tone warm and human, not marketing-blast. Use their first name in the greeting, keep the subject line short and specific, and sign it from me. After a successful send, write a row into the outreach log (or update last_reengaged_at) with the user id and current timestamp so the same person cannot be picked up next week.
Step 3. In HubSpot, use hubspot.Create Task to file a follow-up task for the account's CSM or owner. Subject should name the customer and the reason they tripped the at-risk rule (for example: "Check in on Acme, no login in 18 days"). Body should include the plan tier, the specific rule that fired, the last action and its timestamp, and a link back to the contact in HubSpot. Due date three business days out. Associate the task with the contact record. If the account owner email in the row matches a HubSpot user, assign the task to that owner; otherwise leave it unassigned and note the owner email in the body.
Step 4. At the end of the run, post one summary tally back to me: how many users matched the at-risk rules, how many were skipped for the 30-day cool-off, how many emails were sent, how many HubSpot tasks were created, and any errors. If a step fails for a specific user (bad email, missing owner, HubSpot association error), skip that user and keep going, and include the failures in the summary.
Please ask me for the exact table and column names (users table, activity table, owner mapping, and the outreach log or last_reengaged_at column), the plan tiers that count as paid, the two thresholds (inactivity days and usage-drop percent), the batch cap, and the reply-to signature before you finalize.
Additional information
What does this prompt do?
- Sweeps your product database every Monday morning for paid customers who have gone quiet, whether that is no login in two weeks or a big drop versus their usual weekly usage.
- Drafts and sends a personal re-engagement email from your Gmail that names what they last did, how long it has been, and one concrete next step tied to their plan.
- Files a follow-up task in HubSpot for the account owner or CSM with a three-business-day due date, the reason the account was flagged, and a link back to the contact.
- Skips anyone who already got a re-engagement email in the last 30 days and caps the batch so you never accidentally blast the whole book, then sends you one summary tally.
What do I need to use this?
- A MySQL database with a users or accounts table that tracks plan, last login, and some form of key activity
- A Gmail account you are comfortable sending re-engagement emails from
- A HubSpot login with permission to create tasks and associate them with contacts and account owners
- A small outreach log table or a last-emailed timestamp on your users table, so the workflow can skip anyone contacted in the last 30 days
How can I customize it?
- Change the cadence or time of day, for example move it to Tuesday morning or run it twice a week
- Tighten or loosen the at-risk rule, such as the inactivity window in days, the usage-drop threshold versus baseline, or which plan tiers count
- Adjust the safety rails, including the maximum number of customers touched per run and the cool-off window before someone can be emailed again
- Rewrite the email voice and the CSM task language, and choose whether the follow-up is due in three business days or a different window
Frequently asked questions
How does it decide who counts as at-risk?
Will it accidentally email the same person every week?
Can I keep the run from blasting my whole customer base on day one?
Does this work if my database is not MySQL?
Who does the HubSpot follow-up task get assigned to?
Related templates
Stop losing quiet paid customers before renewal.
Connect MySQL, Gmail, and HubSpot once, and Geni sweeps your at-risk book every Monday at 8am.