Auto-send weekly personalized pet health tips with n8n, GPT-4o-mini, Gmail and Google Sheets
Google Sheets pet data → filter and age calculation → GPT-4o-mini climate-aware tips → Gmail delivery with logging
- Who
- Pet care businesses, veterinary clinics, pet subscription services, animal shelters
- You get
- Weekly automated emails with AI-generated, location and age-specific pet health advice
- You need
- n8n · gmail · google-sheets
Constraints
Requires: n8n instance; Google Sheets OAuth2 credentials; Gmail OAuth2 credentials; OpenAI API key. Two Google Sheets: Pets (master data) and Email_Log (send tracking). Default trigger: Mondays at 9am. Add 2-3 test rows and run manually before enabling schedule.
What they did
Author mssporto published this workflow template on n8n.io. The template uses a Schedule Trigger firing every Monday at 9am to load Active pets from a Google Sheets Pets table, filter records that haven't received an email in 7+ days, calculate pet age in months and a human-readable age string, then call GPT-4o-mini to generate AAHA/WSAVA-aligned, climate-aware veterinary advice based on pet type, age, and location. The personalized HTML email is sent via Gmail, the Pets sheet's Last_Email_Sent timestamp is updated, and a log entry is written to the Email_Log sheet. A disabled SendGrid node is included as an alternative email provider.
How it went
The template has 260 views on n8n.io. The author states it generates personalized tips based on pet type, age, and location, with seasonal examples for the UK, Australia, and Canada. The template supports switching to SendGrid as the email provider, and the author notes the workflow can be adapted for plant care, baby milestones, fitness coaching, and language learning. (Source: author report / template description)
Worth knowing
Choose only one email provider; do not enable both Gmail and SendGrid simultaneously. Country codes must be ISO format (e.g., US, UK, AU, CA). AI tips are for informational purposes only; consult a veterinarian for medical concerns. Age calculation uses a 30.44-day month approximation and may have up to 1-day variance. The SendGrid node's templateId is a placeholder (d-xxxxxx) in workflow.json and must be replaced with a real value. This site has not tested the workflow; verify email content and sheet updates with 1 test pet before enabling the schedule.
n8n workflow template
Structure checked · Not run-testedUse “Import from File” in n8n, or copy the JSON and paste it into the editor. Connect your own accounts, then try test data. The template is inactive by default.
Setup and test checklist
Credentials to connect
- Generate Personalized Tip node: connect OpenAI API credentials.
- Send Health Tip using Gmail node: connect Gmail OAuth2 credentials.
- Update Last_Email_Sent Date node: connect Google Sheets OAuth2 credentials.
- Log to Email_Log Sheet node: connect Google Sheets OAuth2 credentials.
- Load Pet Info node: connect Google Sheets OAuth2 credentials.
Configuration to replace
- Source template is n8n public workflow #9714 (~19 nodes). Keep inactive after import; verify triggers, expressions and external API endpoints.
- Sticky-note guidance is informational; replace placeholders with your own accounts, sheet schemas or channel IDs.
Test input and expected output
- Manually run the main path once in a test workspace and confirm credentialed nodes authenticate without errors.
- Drive one synthetic/redacted sample through and check output fields and downstream writes before enabling in production.
Template changes
- Author credential bindings, webhookId and execution data are removed; the workflow is inactive. Nodes, connections and original prompts are preserved. Not run-tested in n8n.
- No business-logic edits; verify keys, quotas and privacy compliance before use.
Template retrieved: 2026-10-25
Steps
Prepare spreadsheets and test data
Create two sheets in Google Sheets. The Pets sheet has columns: Email, Owner_Name, Pet_Name, Pet_Type, Date_of_Birth, Country (ISO), Status, Last_Email_Sent. The Email_Log sheet has columns: Timestamp, Parent_Email, Pet_Name, Tip_Category, Status. Add 2-3 test pets to Pets with Status = Active and Country in ISO format (e.g., US, UK, AU).
Import workflow and configure credentials and sheet IDs
Import the workflow template into n8n. Add three credentials: openAiApi (OpenAI API key), gmailOAuth2 (Gmail authorization), googleSheetsOAuth2Api (Google Sheets authorization). Then update the documentId in three nodes: 'Load Pet Info' → your Pets sheet ID; 'Update Last_Email_Sent Date' → same Pets sheet ID; 'Log to Email_Log Sheet' → your Email_Log sheet ID.
Setup guidance · Editorial suggestion。Setup assistant starter prompt; confirm inputs, permissions, and node configuration
Help me set up this n8n workflow based on: 1. Source template: https://n8n.io/workflows/9714/ 2. Required credentials: OpenAI API key, Gmail OAuth2, Google Sheets OAuth2 3. Two Google Sheets needed: Pets (Email, Owner_Name, Pet_Name, Pet_Type, Date_of_Birth, Country (ISO), Status, Last_Email_Sent) and Email_Log (Timestamp, Parent_Email, Pet_Name, Tip_Category, Status) 4. After import, update the documentId in three Google Sheets nodes to your actual sheet IDs 5. Test manually with 1 active pet first, verify the email content, then enable the Monday 9am schedule trigger Note: Choose only one email provider (Gmail by default; to use SendGrid, disable the Gmail node and enable the SendGrid node).
Set filtering rules and age calculation
The workflow runs two code nodes automatically: 'Filter: Active + 7-Day Check' keeps only rows where Status = Active and Last_Email_Sent is empty or older than 7 days; 'Calculate Pet Age' converts Date_of_Birth to a readable age (e.g., '2 years and 3 months') and adds pet_age_months and pet_age fields.
Execution prompt · Source text。JS Code field of the 'Filter: Active + 7-Day Check' node
const items = $input.all(); return items.filter(item => { // Must be Active status if (item.json.Status !== 'Active') return false; // Never sent email = include if (!item.json.Last_Email_Sent) return true; // Sent >7 days ago = include const daysSince = (Date.now() - new Date(item.json.Last_Email_Sent)) / (1000*60*60*24); return daysSince > 7; });Execution prompt · Source text。JS Code field of the 'Calculate Pet Age' node
const items = $input.all(); return items.map(item => { const birthDate = new Date(item.json.Date_of_Birth); const ageInMs = Date.now() - birthDate; const ageMonths = Math.floor(ageInMs / (1000 * 60 * 60 * 24 * 30.44)); const ageYears = Math.floor(ageMonths / 12); const remainingMonths = ageMonths % 12; let petAge; if (ageMonths < 12) { petAge = `${ageMonths} month${ageMonths !== 1 ? 's' : ''}`; } else if (remainingMonths === 0) { petAge = `${ageYears} year${ageYears !== 1 ? 's' : ''}`; } else { petAge = `${ageYears} year${ageYears !== 1 ? 's' : ''} and ${remainingMonths} month${remainingMonths !== 1 ? 's' : ''}`; } return { json: { ...item.json, pet_age_months: ageMonths, pet_age: petAge } }; });Configure AI prompt for personalized tip generation
The 'Generate Personalized Tip' node calls GPT-4o-mini (temperature=0.7). The system message sets a veterinary wellness expert role, requiring AAHA/WSAVA-aligned advice tailored to life stage with seasonal considerations. The user message passes pet name, type, age in months, country ISO code, and current date, requesting JSON output with topic, headline, content, and category.
Execution prompt · Source text。System message field of the 'Generate Personalized Tip' node
=You are a veterinary wellness expert providing evidence-based weekly tips for pet owners. Guidelines: - Align with AAHA/WSAVA veterinary standards - Tailor advice to pet type and life stage - Include seasonal considerations ({{ $now.format('MMMM') }}) - Be warm but professional - Always recommend vet consultation for medical concernsExecution prompt · Source text。User message field of the 'Generate Personalized Tip' node
=Generate a personalized pet care tip for: - Pet name: {{ $json.Pet_Name }} - Pet type: {{ $json.Pet_Type }} - Pet age: {{ $json.pet_age_months }} months - Location: Country ISO is {{ $json['Country (ISO)'] }} - Current date: {{ $now.format('MMMM YYYY') }} Requirements: - Veterinary-aligned and breed-appropriate advice - **Climate-specific** (consider hemisphere, season in {{ $json['Country (ISO)'] }}) - Region-specific risks (parasites, weather hazards) - Actionable advice (2-3 sentences) - Brief headline (under 10 words) - Life stage: puppy/kitten (<12mo), adult (1-7yr), senior (7+yr) Examples: - UK October: rain gear, indoor exercise, fireworks anxiety - Australia October: spring heat, snake awareness, hydration - Canada October: early cold prep, paw protection Format as JSON: { "topic": "Brief topic title", "headline": "Engaging headline for {{ $json.Pet_Name }}", "content": "2-3 sentence tip with location-specific advice", "category": "Nutrition/Exercise/Health/Behavior/Safety" }Configure email sending, sheet update, and activity logging
[First-test safety] Before the first test, disable "Send Health Tip using Gmail", or set sendTo to your own test inbox; only enable real sends after "Format Email Data" looks correct. The 'Format Email Data' code node parses the GPT JSON response, extracts topic, headline, content, and category, and merges them with pet data into a unified format. The 'Send Health Tip using Gmail' node sends an HTML email to {{ $json.email }} with subject {{ $json.tip_headline }} and body containing greeting, tip headline, content, and sign-off. After sending, 'Update Last_Email_Sent Date' updates the Pets sheet's Last_Email_Sent timestamp matched by Email column. 'Log to Email_Log Sheet' writes Timestamp, Parent_Email, Pet_Name, Tip_Category, and Status to the Email_Log sheet. Finally, 'Wait 2 Seconds' controls processing pace.
Execution prompt · Source text。JS Code field of the 'Format Email Data' node
// Get pet data from Calculate Pet Age node const petData = $('Calculate Pet Age').item.json; const aiResponse = $json.message.content; const cleanResponse = aiResponse.replace(/```json\n?/g, '').replace(/```\n?/g, '').trim(); let tipData; try { tipData = JSON.parse(cleanResponse); } catch (e) { tipData = { topic: 'Weekly Pet Care Tip', headline: `Important advice for ${petData.Pet_Name}`, content: cleanResponse, category: 'General' }; } return { json: { email: petData.Email, owner_name: petData.Owner_Name, pet_name: petData.Pet_Name, pet_type: petData.Pet_Type, pet_age: petData.pet_age, pet_age_months: petData.pet_age_months, tip_topic: tipData.topic, tip_headline: tipData.headline, tip_content: tipData.content, tip_category: tipData.category, row_number: petData.row_number } };Execution prompt · Source text。Message field (HTML) of the 'Send Health Tip using Gmail' node
=<p>Hi {{ $json.owner_name }},</p> <h3>{{ $json.tip_headline }}</h3> <p>{{ $json.tip_content }}</p> <p>Stay pawsitive! 🐾<br> <em>PetCare Team</em></p>
Prompt you can copy
Setup guidance · Editorial suggestion。Setup assistant starter prompt; confirm inputs, permissions, and node configuration
This block is the prompt. Ads are never placed here.
Help me set up this n8n workflow based on: 1. Source template: https://n8n.io/workflows/9714/ 2. Required credentials: OpenAI API key, Gmail OAuth2, Google Sheets OAuth2 3. Two Google Sheets needed: Pets (Email, Owner_Name, Pet_Name, Pet_Type, Date_of_Birth, Country (ISO), Status, Last_Email_Sent) and Email_Log (Timestamp, Parent_Email, Pet_Name, Tip_Category, Status) 4. After import, update the documentId in three Google Sheets nodes to your actual sheet IDs 5. Test manually with 1 active pet first, verify the email content, then enable the Monday 9am schedule trigger Note: Choose only one email provider (Gmail by default; to use SendGrid, disable the Gmail node and enable the SendGrid node).
Copy the prompt above to a setup assistant. Confirm spreadsheet structure and credential permissions before importing the workflow.
Source
Send weekly personalized pet health tips with GPT-4o-mini, Gmail and Google Sheets · mssporto · n8n.io · 2025-10-15
Comments & feedback
Tried this method? Share results, problems or improvements. Comments appear after moderation. Please avoid sensitive information.
Loading…
Agent feedback
Reports are submitted by Agents and shared after user confirmation and moderation. They are not platform-verified.