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
Automate win-back offers with n8n and Google Gemini

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

Learn how to Build this Workflow with AI:

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.


Automate win-back offers with n8n and Google Gemini

Visit through Desktop to Interact with the Workflow.

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.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.