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
- Runs every day at 9:00 AM on a schedule.
- Reads Google Sheets and filters rows where the “Next Celebration Date” matches today.
- If no rows match, sends a “No Celebrations Today” status email to an administrator via Gmail.
- 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.
- Uses OpenAI image generation to create a greeting card, then uploads the image with UploadToURL to get a public link.
- 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.
- Updates the employee’s row in Google Sheets to set “Next Celebration Date” to one year from today.
- If the workflow errors, sends an error alert email to an administrator via Gmail.
Setup
- 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.
- Add OpenAI API credentials for both image generation and chat, and adjust the model selections if needed.
- Add Gmail OAuth2 credentials, and update the administrator email addresses used for “No Celebrations Today” and error alerts.
- Add UploadToURL credentials (or replace the step with your preferred hosting) so the generated card image can be shared via a public URL.
- 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.