See llms.txt for all machine-readable content.

Back to Templates

Send AI birthday and anniversary cards with Google Sheets, OpenAI, and Gmail

Quick overview

This workflow runs daily, checks Google Sheets for employees with a birthday or anniversary today, generates a personalized greeting card image and message using OpenAI, emails the employee via Gmail, and then updates the next celebration date in the spreadsheet.

How it works

  1. Runs every day at 9:00 AM on a schedule.
  2. Reads Google Sheets and filters rows where the “Next Celebration Date” matches today.
  3. If no rows match, sends a “No Celebrations Today” status email to an administrator via Gmail.
  4. If celebrations exist, routes each row based on whether the “Event Type” is Birthday or Anniversary and builds an image prompt that includes the employee’s name.
  5. Uses OpenAI image generation to create a greeting card, then uploads the image with UploadToURL to get a public link.
  6. Uses OpenAI chat to generate a short congratulatory message and sends an HTML email with the message and embedded card image to the employee via Gmail.
  7. Updates the employee’s row in Google Sheets to set “Next Celebration Date” to one year from today.
  8. If the workflow errors, sends an error alert email to an administrator via Gmail.

Setup

  1. Create and connect Google Sheets OAuth2 credentials, and ensure your sheet contains the columns Employee Name, Email Address, Event Type, Next Celebration Date, and row_number.
  2. Add OpenAI API credentials for both image generation and chat, and adjust the model selections if needed.
  3. Add Gmail OAuth2 credentials, and update the administrator email addresses used for “No Celebrations Today” and error alerts.
  4. Add UploadToURL credentials (or replace the step with your preferred hosting) so the generated card image can be shared via a public URL.
  5. Set your Google Sheets document and sheet tab in the read and update steps, and ensure “Next Celebration Date” uses the yyyy-MM-dd format for matching.