Quick overview
This workflow runs every 15 minutes to pull upcoming Google Calendar meetings, find related Gmail threads for context, and use OpenAI (GPT-4o-mini) to generate a concise agenda, then creates a Gmail draft, sends a Telegram alert, and logs processed events to Google Sheets to avoid duplicates.
How it works
- Runs every 15 minutes on a schedule trigger.
- Fetches upcoming events from Google Calendar and reads previously processed event IDs from a Google Sheets “Meeting Prep Log” tab.
- Skips meetings that already exist in the log, then iterates through each unprocessed meeting.
- Searches Gmail for recent emails from the meeting attendees (within the last 30 days) and compiles snippets into a single meeting-context prompt.
- Sends the meeting details and email context to OpenAI (gpt-4o-mini) to generate a Markdown agenda and prep brief.
- Creates a Gmail draft addressed to the meeting attendees, sends a Telegram message with the formatted agenda, and appends the meeting’s Event ID and title to Google Sheets.
- If the workflow errors, it sends an alert to Slack and to Telegram via the error trigger.
Setup
- Connect credentials for Google Calendar OAuth2, Gmail OAuth2, OpenAI API, Google Sheets OAuth2, Slack OAuth2, and Telegram Bot API.
- Replace
REPLACE_WITH_YOUR_MEETING_PREP_SHEET_ID with your Google Sheets document ID and ensure a “Meeting Prep Log” sheet exists with an “Event ID” column.
- Set
REPLACE_WITH_YOUR_TELEGRAM_CHAT_ID for meeting alerts and YOUR_ADMIN_TELEGRAM_CHAT_ID for error alerts, and confirm the Slack channel selection for error notifications.