Automate Customer Win-Back Offers with n8n and Google Gemini

Struggling to re-engage customers at risk of leaving? This n8n workflow automates identifying high churn risk customers from Google Sheets, generates personalized win-back offers using Google Gemini AI, and sends them via Gmail—saving time and boosting retention.
scheduleTrigger
googleSheets
filter
+8
Workflow Identifier: 2146
NODES in Use: Schedule Trigger, Google Sheets, Filter, IF, SplitInBatches, Langchain Chain LLM, Langchain LM Chat Google Gemini, Langchain Output Parser Structured, Gmail, Set, Sticky Note

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this workflow does

This workflow runs daily to check customers who might stop buying.

It finds those with high churn risk and no past campaigns, then creates custom offers using Google Gemini AI.

The offers get sent by email and logged to track actions.

This saves time, reduces mistakes and helps keep customers buying.


Tools and services this workflow uses

  • Google Sheets: Stores customer data and system logs.
  • Google OAuth credentials: Allow access to Google Sheets and Gmail.
  • Google Gemini AI (PaLM API): Generates personalized win-back offers.
  • Gmail API: Sends emails with the offers.
  • n8n Workflow Automation: Runs the process steps automatically every day.

How this workflow works (Input → Process → Output)

Input

  • Customer data from a Google Sheet named “Customer Data”.
  • Includes customer email, churn risk score, product preferences, and past campaign date.

Processing Steps

  • The workflow starts automatically every day via the Scheduled Start: Daily Churn Check node.
  • It fetches all customer records from the “Customer Data” sheet using a Google Sheets node.
  • A filter node selects customers with churn risk over 0.7 who have not received earlier campaigns (filtering by missing or empty campaign date is advised).
  • An IF node checks if there are any eligible customers to continue.
  • If none found, the system logs “NOT_FOUND” to the “SYSTEM_LOG” Google Sheet.
  • If eligible customers found, they are processed in batches for API performance.
  • Google Gemini AI generates personalized offers based on risk and preferences, with different offer types depending on churn level.
  • Offers are parsed from AI output to JSON format for consistency.
  • Sent offers are logged in the “SYSTEM_LOG” sheet with timestamps and customer IDs.
  • Gmail node sends the offers by email, using customer email addresses and personalized content.

Output

  • Emails with customized win-back offers sent to at-risk customers.
  • System logs in Google Sheets recording sent offers and empty campaign days.

Beginner step-by-step: How to use this workflow in n8n production

Step 1: Import the workflow

  1. Click Download button on this page to save the workflow file.
  2. In the n8n editor, choose “Import from File” and select the workflow file you downloaded.

Step 2: Configure credentials and IDs

  1. Open the Google Sheets nodes and set the correct Google Sheets document ID and sheet names if different.
  2. Add Google OAuth2 credentials for Sheets and Gmail (check scopes to allow read, write, and send email).
  3. In the AI node Generate Win-Back Offer, add the Google Gemini API Key or credentials in the settings.
  4. Confirm the Gmail node has valid OAuth2 credentials for sending emails.

Step 3: Test the workflow

  1. Run the workflow once manually inside n8n to confirm data fetching, filtering, AI generation, logging, and email sending works.
  2. Check Google Sheets logs and receive test email.

Step 4: Activate for daily automation

  1. Activate the Scheduled Start: Daily Churn Check node so it runs every day without manual action.
  2. Monitor “SYSTEM_LOG” sheet and n8n execution history for any errors after deployment.

For more control and security, consider running a self-host n8n instance to handle credentials and workflows privately.


Common customization ideas

  • Add filter condition in Filter High Churn Risk & No Campaign Customers to exclude customers where created_campaign_date is not empty to avoid repeat offers.
  • Change AI prompt and output to support SMS or push notifications, then add nodes to send messages via other platforms.
  • Adjust churn score thresholds and offer types in the AI node prompt to tailor perks more closely to business needs.
  • Modify batch size in the split batches node to balance API limits and processing speed.
  • Use AI prompt language parameter or add locale data from customers to create emails in different languages.

What to watch out for (troubleshooting)

Issue: No data returned from Google Sheets node

Check if sheet names and document ID are exactly correct.

Make sure Google OAuth credentials have permission to access the spreadsheet.

Issue: AI node fails to generate or produces bad JSON

Review and correct the AI prompt format.

Ensure Google Gemini API keys are active and have available quota.

Use the JSON parsing node to handle AI output carefully.

Issue: Emails do not send after offer generation

Reauthorize or refresh Gmail OAuth credentials.

Check the customer email fields are valid and correctly mapped.

Summary of results

✓ The workflow runs daily and finds high-risk customers quickly.

✓ It creates personal offers by Google Gemini AI that match risk and interests.

✓ Offers are emailed automatically via Gmail with tracking in Google Sheets.

→ This saves lots of manual work and helps keep more customers buying through timely engagement.


Frequently Asked Questions

Yes, other AI models supported by n8n such as OpenAI can be used by changing the AI node and adjusting prompts.
AI calls depend on the number of customers processed daily; Google Sheets and Gmail APIs have free limits suitable for most mid-sized workflows.
Google Gemini runs on Google Cloud with strong security, but users should review data privacy policies before sending sensitive info.
Yes, batching and efficient Google Sheets queries support large data sets but watch API rate limits and adjust batch sizes accordingly.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free