Blog · · 4 min read

How to remind customers before their contract or service expires with n8n and AI

Step-by-step guide to having n8n check your contracts in Google Sheets every morning, spot the ones expiring soon and use AI to draft a personalised renewal reminder for each customer.

Many small businesses live on services that renew: boiler maintenance, a yearly gym membership, an insurance policy, an IT support plan or a vehicle service. The problem is that the expiry date usually sits in a spreadsheet nobody looks at, and by the time you remember, the customer has signed up with someone else.

In this guide you'll build an n8n workflow that checks your contracts in Google Sheets every morning, finds the ones expiring in the next 30 days and uses AI to write a personalised renewal reminder as a Gmail draft. You review the draft and send it.

What you'll build

A five-step workflow that runs on its own every day:

  1. Daily trigger: a Schedule Trigger node runs at 9:00.
  2. Read contracts: the Google Sheets node reads your "Contracts" sheet.
  3. Date filter: a Code node keeps the contracts expiring in 30 or 7 days that haven't been reminded at that stage yet.
  4. AI reminder: a Basic LLM Chain node writes a friendly email recalling what the service includes and when it expires.
  5. Draft and log: Gmail creates the draft and Google Sheets records the stage in reminder_sent.

What you need

  • An n8n instance (cloud or installed for free on your computer).
  • Google Sheets and Gmail connected in n8n.
  • An OpenAI (or other AI provider) API key, with a monthly spending limit set in its dashboard.
  • A "Contracts" sheet with these columns: customer, email, service, price, expires_on (YYYY-MM-DD), notes and reminder_sent (empty).

Step 1: set up the contracts sheet

The key is that expires_on always uses the same date format. In notes you can add details that help personalise the message, such as "customer since 2021" or "prefers afternoon calls". The reminder_sent column will hold 30 or 7 depending on which reminder has already been prepared.

Step 2: trigger and read

Add a daily Schedule Trigger at 9:00 (check the workflow time zone in Settings). Connect it to Google Sheets → Get Row(s) pointing at your "Contracts" sheet.

Step 3: filter contracts expiring soon

Add a Code node (Run Once for All Items mode) with this code:

const today = new Date(); today.setHours(0, 0, 0, 0);
const out = [];
for (const i of $input.all()) {
  const c = i.json;
  if (!c.email || !c.expires_on) continue;
  const days = Math.round((new Date(c.expires_on) - today) / 86400000);
  let stage = null;
  if (days <= 7 && days >= 0) stage = '7';
  else if (days <= 30 && days > 7) stage = '30';
  if (!stage || String(c.reminder_sent) === stage) continue;
  out.push({ json: { ...c, days, stage } });
}
return out;

This way each customer gets at most two reminders: one a month before and one in the final week. If nothing is expiring, the workflow stops without spending on AI.

Step 4: write the reminder with AI

Add a Basic LLM Chain with a small, cheap model (for example gpt-4o-mini) and this prompt:

You handle customers for [BUSINESS NAME]. Write a short email to {{ $json.customer }}
reminding them that their "{{ $json.service }}" service expires on {{ $json.expires_on }}
({{ $json.days }} days left). Renewal price: €{{ $json.price }}.
Notes about the customer: {{ $json.notes }}
- Friendly, professional tone, in English, 6 sentences max.
- Explain in one sentence what they lose if they don't renew, without pressure.
- End by inviting them to reply to renew or ask questions.
- Do not invent discounts, dates or terms.
Return only the email body.

The data (date and price) always comes from your sheet; the AI only sets the tone and personalises with the notes.

Step 5: create the draft and log the reminder

Connect a Gmail → Create Draft node with recipient {{ $('Code').item.json.email }}, subject Your {{ $('Code').item.json.service }} expires soon and the AI text as the body. Drafts let you review before sending, just like in AI email reply drafts.

Then add a Google Sheets → Update Row node that matches on email and writes the stage into reminder_sent. When the customer renews, update expires_on to the new date and clear reminder_sent.

Once you trust the texts, you can switch Create Draft to Send so reminders go out on their own.

How to test it

  1. Add a test row with your own email and an expires_on 20 days from now.
  2. Run the workflow manually and check the draft appears and reminder_sent becomes 30.
  3. Run it again: no new draft should be created.
  4. Change the date to 5 days from now and confirm the second reminder is prepared.

Cost and good practice

  • Cost: each reminder costs less than a tenth of a cent in AI API fees. With a hundred contracts a year, the cost is negligible.
  • Respect privacy: only remind customers with an active contract and always make it easy to reply.
  • Get error alerts: set up an error workflow so you know if Gmail or the sheet fails, as covered in n8n error handling.
  • Combine it with quote follow-ups so you lose neither new customers nor renewals.

Start with ready-to-import templates

If you want your customer service foundation in n8n ready today, download the free WhatsApp agent or check out the full AgentKiosk pack: 8 tested agents in English and Spanish, each with its workflow, prompt and guide, ready to import and combine with these renewal reminders.