See llms.txt for all machine-readable content.

Back to Templates

Win back lapsed clients with OpenAI, Google Sheets and Gmail

Quick overview

This workflow runs every Monday, reads a client list from Google Sheets, uses an OpenAI chat model to draft personalized win-back messages, and sends them via Gmail while updating the sheet and emailing staff a delivery summary.

How it works

  1. Runs every Monday morning on a schedule.
  2. Validates the configured settings, reads the Clients tab from Google Sheets, and stops if required column headers are missing.
  3. Filters for opted-in clients who are lapsed past the configured threshold and not contacted within the cooldown window, prioritizing the highest total visits and limiting the run to a maximum count.
  4. Generates a short personalized email draft for each selected client using an OpenAI chat model and pairs each draft with the correct client record.
  5. Validates the draft (for length, links, placeholders, offers, and correct salutation), builds the final email with offer, booking URL, postal address, and unsubscribe instructions, and updates Google Sheets to mark the client as being contacted.
  6. Sends each win-back email via Gmail (or routes all emails to the staff address in test mode) and then writes the final delivery result back to Google Sheets.
  7. Emails staff a campaign summary via Gmail and separately alerts staff about any opted-in rows with invalid IDs, emails, or dates.

Setup

  1. Create a Google Sheets document with a Clients tab and these exact headers: Client ID, Client Name, Client Email, Last Service, Last Visit Date, Total Visits, Marketing Opt In, Last Win Back At, Last Win Back Error. Use YYYY-MM-DD for Last Visit Date and yes or no for Marketing Opt In.
  2. Connect Google Sheets (OAuth2), Gmail and OpenAI credentials.
  3. In Set Workflow Settings, set your sheet ID, business name, businessAddress (printed at the bottom of every email), staffEmail, replyToEmail, bookingPageUrl and offerText. The workflow refuses to run while a placeholder is left. Optionally change brandVoice, lapsedAfterDays, contactCooldownDays and maxEmailsPerRun.
  4. Set the workflow timezone in Workflow settings.
  5. Leave testMode on for the first run (every email goes only to staffEmail and the sheet is not changed), then switch it off and activate the workflow.

Requirements

  • Google Sheets account connected with OAuth2
  • Gmail account
  • OpenAI API key, or any other chat model. Client first names and visit history are sent to it, so mention this in your privacy notice.

Customization

  • Change offerText, brandVoice and the lapsed and cooldown days in Set Workflow Settings
  • Swap the OpenAI GPT-4 Mini Chatbot node for Anthropic, Google Gemini or a local model
  • Edit the fallback text and footer in the Assemble Final Email Content node

Additional info

Only clients whose Marketing Opt In is yes (or ticked) are emailed. Replies saying "unsubscribe" arrive in your inbox: set that client's Marketing Opt In to no. The staff summary repeats this reminder.