See llms.txt for all machine-readable content.

Back to Templates

Send a daily unanswered leads digest with Gmail and OpenAI

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

  1. Runs every weekday at 8 AM (or manually) and loads configuration like your email, business description, lookback window, and delivery mode.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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

  1. Connect your Gmail account (OAuth2) so the workflow can read your inbox and create a draft or send an email.
  2. Add an OpenAI API credential for the OpenAI Chat Model used by the workflow.
  3. 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.
  4. 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.