Automated daily customer win-back campaign with AI offers
Proactively retain customers predicted to churn with this automated n8n workflow. Running daily, it identifies high-risk customers from your Google Sheet, us...
🔌 Nodes & Integrations Used (5)
📖 Implementation & Setup Guide
Proactively retain customers predicted to churn with this automated n8n workflow. Running daily, it identifies high-risk customers from your Google Sheet, uses Google Gemini to generate personalized win-back offers based on their churn score and preferences, sends these offers via Gmail, and logs all actions for tracking.
What does this workflow do?
This workflow automates the critical process of customer retention by:
* **Running automatically every day** on a schedule you define. * **Fetching customer data** from a designated Google Sheet containing metrics like predicted churn scores and preferred categories. * **Filtering** to identify customers with a high churn risk (score > 0.7) who haven't recently received a specific campaign (based on the `created_campaign_date` field - *you might need to adjust this logic*). * Using **Google Gemini AI** to dynamically generate one of three types of win-back offers, personalized based on the customer's specific churn score and preferred product categories: * **Informational:** (Score 0.7-0.8) Highlights new items in preferred categories. * **Bonus Points:** (Score 0.8-0.9) Offers points for purchases in a target category (e.g., Books). * **Discount Percentage:** (Score 0.9-1.0) Offers a percentage discount in a target category (e.g., Books). * **Sending the personalized offer** directly to the customer via **Gmail**. * **Logging** each sent offer or the absence of eligible customers for the day in a separate 'SYSTEM_LOG' Google Sheet for monitoring and analysis.
Who is this for?
* **CRM Managers & Retention Specialists:** Automate personalized outreach to at-risk customers. * **Marketing Teams:** Implement data-driven retention campaigns with minimal manual effort. * **E-commerce Businesses & Subscription Services:** Proactively reduce churn and increase customer lifetime value. * **Anyone** using customer data (especially churn prediction scores) who wants to automate personalized retention efforts via email.
Benefits
* **Automated Retention:** Set it up once, and it runs daily to engage at-risk customers automatically. * **AI-Powered Personalization:** Go beyond generic offers; tailor messages based on churn risk and customer preferences using Gemini. * **Proactive Churn Reduction:** Intervene *before* customers leave by addressing high churn scores with relevant offers. * **Scalability:** Handle personalized outreach for many customers without manual intervention. * **Improved Customer Loyalty:** Show customers you value them with relevant, timely offers. * **Action Logging:** Keep track of which customers received offers and when the workflow ran.
How it Works
- **Daily Trigger:** The workflow starts automatically based on the schedule set (e.g., daily at 9 AM).
- **Fetch Data:** Reads all customer data from your 'Customer Data' Google Sheet.
- **Filter Customers:** Selects customers where `predicted_churn_score > 0.7` AND `created_campaign_date` is empty (*verify this condition fits your needs*).
- **Check for Eligibility:** Determines if any customers passed the filter.
- **IF Eligible Customers Found:**
- * **Loop:** Processes each eligible customer one by one.
- * **Generate Offer (Gemini):** Sends the customer's `predicted_churn_score` and `preferred_categories` to Gemini. Gemini analyzes these and the defined rules to create the appropriate offer type, value, title, and detailed message, returning it as structured JSON.
- * **Log Sent Offer:** Records `action_taken = SENT_WINBACK_OFFER`, the timestamp, and `customer_id` in the 'SYSTEM_LOG' sheet.
- * **Send Email:** Uses the Gmail node to send an email to the customer's `user_mail` with the generated `offer_title` as the subject and `offer_details` as the body.
- **IF No Eligible Customers Found:**
- * **Set Status:** Creates a record indicating `system_log = NOT_FOUND`.
- * **Log Status:** Records this 'NOT_FOUND' status and the current timestamp in the 'SYSTEM_LOG' sheet.
n8n Nodes Used
* Schedule Trigger * Google Sheets (x3 - Read Customers, Log Sent Offer, Log Not Found) * Filter * If * SplitInBatches (Used for Looping) * Langchain Chain - LLM (Gemini Offer Generation) * Langchain Chat Model - Google Gemini * Langchain Output Parser - Structured * Set (Prepare 'Not Found' Log) * Gmail (Send Offer Email)
Prerequisites
* Active n8n instance (Cloud or Self-Hosted). * **Google Account** with access to Google Sheets and Gmail. * **Google Sheets API Credentials (OAuth2):** Configured in n8n. * **Two Google Sheets:** * **'Customer Data' Sheet:** Must contain columns like `customer_id`, `predicted_churn_score` (numeric), `preferred_categories` (string, e.g., `["Books", "Electronics"]`), `user_mail` (string), and potentially `created_campaign_date` (date/string). * **'SYSTEM_LOG' Sheet:** Should have columns like `system_log` (string), `date` (string/timestamp), and `customer_id` (string, optional for 'NOT_FOUND' logs). * **Google Cloud Project** with the Vertex AI API enabled. * **Google Gemini API Credentials:** Configured in n8n (usually via Google Vertex AI credentials). * **Gmail API Credentials (OAuth2):** Configured in n8n with permission to send emails.
Setup
- Import the workflow JSON into your n8n instance.
- **Configure Schedule Trigger:** Set the desired daily run time (e.g., `Hours` set to `9`).
- **Configure Google Sheets Nodes:**
- * Select your Google Sheets OAuth2 credentials for all three Google Sheets nodes.
- * **`1. Fetch Customer Data...`:** Enter your 'Customer Data' Spreadsheet ID and Sheet Name.
- * **`5b. Log Sent Offer...`:** Enter your 'SYSTEM_LOG' Spreadsheet ID and Sheet Name. Verify column mapping.
- * **`3b. Log 'Not Found'...`:** Enter your 'SYSTEM_LOG' Spreadsheet ID and Sheet Name. Verify column mapping.
- **Configure Filter Node (`2. Filter High Churn Risk...`):**
- * **Crucially, review the second condition:** `{{ $json.created_campaign_date.isEmpty() }}`. Ensure this field and logic correctly identify customers who *should* receive the offer based on your campaign strategy. Modify or remove if necessary.
- **Configure Google Gemini Nodes:** Select your configured Google Vertex AI / Gemini credentials in the `Google Gemini Chat Model` node. Review the prompt in the `5a. Generate Win-Back Offer...` node to ensure the offer logic matches your business rules (especially category names like "Books").
- **Configure Gmail Node (`5c. Send Win-Back Offer...`):** Select your Gmail OAuth2 credentials.
- **Activate the workflow.**
- Ensure your 'Customer Data' and 'SYSTEM_LOG' Google Sheets are correctly set up and populated. The workflow will run automatically at the next scheduled time.
This workflow provides a powerful, automated way to engage customers showing signs of churn, using personalized AI-driven offers to encourage them to stay. Adapt the filtering and offer logic to perfectly match your business needs!
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Automated daily customer win-back campaign with AI offers.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related Email & Outreach Workflows
View All in Email & Outreach →Abandoned cart recovery for Shopify via Gmail Google Sheets T
Who is this for? This template is ideal for solo store owners, eCommerce marketers, automation beginners, or anyone using Shopify and Gmail who wants to reco...
Add new leads in Lemlist from Airtable
This workflow allows you to add new leads in Lemlist from Airtable. !workflow-screenshot Airtable node: This node lists all the emails that are stored in you...
Add Subscriber and Send Email Campaign
Production-ready n8n automation template for Add Subscriber and Send Email Campaign built by AhiXLight. Seamlessly connects Sendy with 3 configured nodes.
Add new contacts from HubSpot to the email list in Mailchimp
This workflow adds new HubSpot contacts to the Mailchimp email list. Prerequisites - HubSpot account and HubSpot credentials - Mailchimp account and Mailchim...