Quick overview
This workflow runs every weekday morning to scan Gmail for recent threads where someone emailed you but you haven’t replied or drafted a response, then uses OpenAI to prioritize and summarize the most important leads and delivers a single digest to you as a Gmail draft or email.
How it works
- Runs every weekday at 8 AM (or manually) and loads configuration like your email, business description, lookback window, and delivery mode.
- In test mode it uses a built-in sample inbox, otherwise it fetches recent Gmail messages from your inbox plus your Sent mail and Drafts for the configured lookback period.
- Compares incoming threads against your Sent and Draft messages to keep only threads where the newest message is from someone else and you have not replied or started a draft.
- Screens the remaining messages to skip newsletters, no-reply/automated senders, and very recent emails, and flags potentially risky or prompt-injection content (for example wire transfer keywords) to keep it out of OpenAI.
- Sends the safe candidates to OpenAI with structured output to classify the email type, rate urgency, and generate a short summary and next-step suggestion.
- Validates and cleans the AI results, builds a ranked digest with Gmail thread links plus a separate “read these yourself” list for flagged/unclear items, and then either emails the digest to you or saves it as a Gmail draft (and can optionally send even when empty).
Setup
- Connect your Gmail account (OAuth2) so the workflow can read your inbox and create a draft or send an email.
- Add an OpenAI API credential for the OpenAI Chat Model used by the workflow.
- In the configuration step, set your_email and your_business, and optionally adjust lookback_days, quiet_hours, max_ai_checks, tripwires, skip_senders, delivery (draft/email), and send_when_empty.
- Run once with test_mode set to yes to verify the digest output using sample emails, then set test_mode to no and activate the scheduled workflow.