Weekly at-risk customer re-engagement from MySQL to Gmail and HubSpot

By General Input

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.

Integrations

  • MySQL
  • Gmail
  • HubSpot

Type

Agentic Task

Categories

  • Sales
  • Operations

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.

Related prompts

Explore more prompts
Win back LiveChat visitors whose chats went unansweredTurn Mailjet email clicks into ranked HubSpot follow-upsiMessage campaign console with pre-flight checks and delivery boardA searchable RFP answer library your bid team drafts fromSee which target accounts just started advertising on LinkedInAccount health board that puts product usage next to your CRMLook up a customer's full chat history mid conversationChase the paperwork every new client and vendor still owesLusha prospecting workbench with credit-safe revealsWhich companies your LinkedIn ads reach, matched to your CRM