Save your real Gmail conversations to Google Contacts every Monday

By General Input

Every Monday morning, an agent finds the people you actually email back and forth with, adds them to Google Contacts, and posts a tidy summary to Slack.

Integrations

  • Gmail
  • Google Contacts
  • Slack

Type

Agentic Task

Categories

  • Personal Productivity
  • Operations

Every Monday at 9am local time, sweep my Gmail for people I have been emailing back and forth with who are not yet in my Google Contacts, add the real humans, and post a summary to Slack.

Trigger: cron, every Monday at 9am.

Step 1. Use Gmail List Messages with a query that covers the last 30 days in both Sent and Inbox (something like newer_than:30d in:sent OR newer_than:30d in:inbox). Page through results and pull headers with Gmail Get a Message (metadata format is enough for the grouping pass) so you have From, To, Cc, and Date for each message.

Step 2. Group messages by the counterparty email address (the non-me side). Keep only addresses where I sent them at least 2 messages AND they sent me at least 2 messages in the window. This is the real-conversation filter. One-off blasts in either direction do not count.

Step 3. For each surviving candidate, check whether the address is already saved using Google Contacts. Note: the People API requires a warmup call to Search Contacts with an empty query before the first real search will return results, so do that once at the start of this step. Then for each candidate, call Search Contacts with the email, and also call Search Other Contacts (the auto-saved bucket Gmail populates) with the email. If either returns a match, drop the candidate.

Step 4. Judge the remainder. Skip no-reply patterns (noreply, no-reply, donotreply, mailer-daemon, postmaster, notifications@, alerts@, etc.), newsletter and marketing senders, transactional/receipt senders, and obvious automated mail like calendar invites and shipping notifications. Use the From display name, the sender domain, and one sample message body via Gmail Get a Message (full format) to make the call. When in doubt, skip and explain why in the summary.

Step 5. For each survivor, extract a best-guess full name. Prefer a clean name from the From header (strip quotes and any address). If the From name looks like an email or is missing, parse the most recent signature block from a sample message body for a likely first and last name. Keep it to ONE name entry per contact: Google Contacts treats names as a singleton field and will reject a create with multiple.

Step 6. Make sure a contact group called "Auto-Saved from Gmail" exists. List Contact Groups first to check; if it is not there, Create Contact Group with that name. Hold on to its resource name for the next step.

Step 7. Use Google Contacts Batch Create Contacts to add all the survivors in one call (cap at 200 per batch, page if needed). Each contact gets one name entry, the email address, and membership in the Auto-Saved from Gmail group.

Step 8. Post a single Slack message to the channel I pick when setting this up. Format it as a short readable summary: a header like "Saved N new contacts from Gmail this week", then a list of who got added with their name, email, and how many back-and-forth exchanges I had with them in the window, then a short "Skipped (borderline)" section listing any candidates the agent deliberately dropped along with the reason (looked like a newsletter, no real name found, etc.). Use Slack mrkdwn (single asterisks for bold). If nothing was saved, post a brief note saying so instead of nothing.

Ask me for: the Slack channel to post the summary in, and confirm the timezone for the Monday 9am trigger. Default everything else (30-day window, 2-and-2 threshold, group name).

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsChase the paperwork every new client and vendor still owesFile Gmail attachments into storage with names you can findWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teams