Example Customer Data
Configured with Chain LLM, Filter, Gmail, Google Sheets, and additional nodes. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- Data store
- Routing
- AI & models
- Transform
- Messaging
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| Scheduled Start: Daily Churn Check | Trigger | Schedule Trigger | See node parameters |
| Fetch Customer Data from Sheet | Data store | Google Sheets | See node parameters |
| Filter High Churn Risk & No Campaign Customers | Routing | Filter | See node parameters |
| Check if Eligible Customers Found | Routing | If | See node parameters |
| Process Each Eligible Customer | Routing | Loop Over Items | See node parameters |
| Generate Win-Back Offer | AI & models | Chain LLM | See node parameters |
| (LLM Model for Offer Generation) | AI & models | LM Chat Google Gemini | See node parameters |
| (Parse Offer JSON) | Transform | Output Parser Structured | See node parameters |
| Log Sent Offer in System Log | Data store | Google Sheets | appendOrUpdate |
| Send Win-Back Offer via Email | Messaging | Gmail | See node parameters |
| Set 'Not Found' Status | Transform | Edit Fields | See node parameters |
| Log 'Not Found' in System Log | Data store | Google Sheets | appendOrUpdate |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
gmailOAuth2googlePalmApigoogleSheetsOAuth2Api
Workflow notes
00. Daily Start & Fetch Customer Data
00. Daily Start & Fetch Customer Data
Purpose: Automatically triggers the workflow once daily based on the schedule set in the first node. It then fetches all customer data from the specified Google Sheet ('Customer Data' sheet) to identify potential churn risks for the day.
03. Handle No Eligible Customers
03. Handle No Eligible Customers
Purpose: This path executes if the initial filter finds no customers meeting the win-back criteria during the daily check.
- Set Status: Sets a variable indicating no eligible customers were found (
system_log = NOT_FOUND). - Log Status: Records this 'NOT_FOUND' status along with the current timestamp in the 'SYSTEM_LOG' Google Sheet. This helps track when the daily workflow ran but had no one to process.
01. Filter & Branch
01. Filter & Branch
Purpose: Filters the fetched customer data to identify those meeting specific win-back criteria:
predicted_churn_scoreis greater than 0.7.- No previous campaign date exists (
created_campaign_dateis empty - Note: Verify this field's purpose or adjust logic if needed). Then, it checks if any customers passed the filter. The workflow branches based on whether eligible customers were found.
02. Generate & Send Win-Back Offer (Loop)
02. Generate & Send Win-Back Offer (Loop)
Purpose: Processes each eligible customer found in the previous step individually within a loop.
- Generate Offer (Gemini): Uses Google Gemini to create a personalized win-back offer (Informational, Bonus Points, or Discount) based on the customer's
predicted_churn_scoreandpreferred_categories. Outputs offer details in JSON format. - Log Sent Offer: Records the successful generation and intent to send the offer (action_taken, timestamp, customer_id) in the 'SYSTEM_LOG' Google Sheet.
- Send Email (Gmail): Sends the generated offer details (
offer_titleandoffer_details) via email to the customer'suser_mail. The loop continues until all eligible customers are processed.
Example Customer Data
Example Customer Data
{ "customer_id": "CUST_001", "last_purchase_date": "2024-01-10T10:00:00Z", "purchase_frequency_days": 90, "user_mail":"user@example.com", "days_since_last_purchase": 110, "total_spent_usd": 55.0, "preferred_categories": ["Kitap", "Ofis Malzemeleri"], "predicted_churn_score": 0.85, "profile_tags": ["inactive_long_time", "low_spender"], "timestamp": "2024-06-08T09:00:00Z" }
Example Customer Data
Example Customer Data
Purpose and structure
This folder contains the Example Customer Data workflow. Its executable nodes use chainLlm, filter, gmail, googleSheets, if, lmChatGoogleGemini, outputParserStructured, scheduleTrigger, set, splitInBatches. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Scheduled Start: Daily Churn Check
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Filter/0948_Filter_Schedule_Create_Scheduled.json MIT; preserve source notices.