If you followed my last guide, you now have a fantastic automated system: the AI-Powered Birthday Notification System. But why stop at automation? We can transform this passive reporter into a simple AI Agent that solves the next most common problem: What gift should I buy?
This guide helps you build a Two-Stage AI-Powered Birthday Notification System using Google Sheets, Google Apps Script, and the Gemini API — moving beyond simple automation into agent territory.
Google Sheets (The Data)
Holds names, dates, and tracks two separate sent dates — message and gift.
Google Apps Script (The Engine)
Runs daily, checks two different dates (Today and 14 Days Out), and manages two separate email sends.
Gemini API (The Intelligence)
Generates two distinct outputs — a personalised birthday message and thoughtful gift recommendations.
A: Name. B: Birthday (MM/DD). C: Classification (1=Close Family, 3=Close Friends receive gift suggestions + message; 2=Extended Family, 4=Friends receive message only; 5=Deceased receive reflective message only).
D: Last Sent Year (managed by the agent). E: Notes/Context (critical — used for personalised messages AND gift ideas). F: Last Gift Sent Year (new column tracking the gift reminder separately).
Create a Google Sheet named “Birthday AI Reminder” with a tab named exactly “Birthdays”.
Open Extensions > Apps Script, paste the complete agent code, update the RECIPIENT_EMAIL variable.
Verify your Gemini API Key in Project Settings. Run mainDailyCheck to grant permissions.
Select createDailyTrigger and click Run. The script will now run every day between 7:00 AM and 8:00 AM.
Troubleshooting
Don't just read experiment. Browse our hands-on experiments designed to help you apply what you've learned.
Browse Experiments