{
 "name": "RecipeAgents: Flag upset customers before they churn",
 "nodes": [
  {
   "parameters": {
    "pollTimes": {
     "item": [
      {
       "mode": "everyMinute"
      }
     ]
    },
    "simple": false,
    "filters": {
     "q": "in:inbox -category:promotions"
    },
    "options": {}
   },
   "id": "39fb1f9a-fbc3-4171-8544-e9f4f7f1194b",
   "name": "Gmail Trigger",
   "type": "n8n-nodes-base.gmailTrigger",
   "typeVersion": 1.2,
   "position": [
    240,
    300
   ]
  },
  {
   "parameters": {
    "modelId": {
     "__rl": true,
     "value": "gpt-4o-mini",
     "mode": "list",
     "cachedResultName": "GPT-4O-MINI"
    },
    "messages": {
     "values": [
      {
       "content": "=Rate this customer message: calm | frustrated | upset | cancel_risk. Return JSON {level, reason (quote the phrase)}. Sarcasm counts. Message: {{ JSON.stringify($json) }}"
      }
     ]
    },
    "jsonOutput": true,
    "options": {}
   },
   "id": "e07408a9-db17-45b3-a7fe-08efc05cc955",
   "name": "AI step",
   "type": "@n8n/n8n-nodes-langchain.openAi",
   "typeVersion": 1.8,
   "position": [
    500,
    300
   ]
  },
  {
   "parameters": {
    "select": "channel",
    "channelId": {
     "__rl": true,
     "value": "",
     "mode": "list"
    },
    "text": "={{ JSON.stringify($json.message.content) }}",
    "otherOptions": {}
   },
   "id": "8cf4edcd-fbb5-4474-a1f3-a18dee347a47",
   "name": "Post to Slack",
   "type": "n8n-nodes-base.slack",
   "typeVersion": 2.2,
   "position": [
    760,
    300
   ]
  },
  {
   "parameters": {
    "content": "## Flag upset customers before they churn\nFrom recipeagents.usestarbase.com/recipes/angry-email-flag\n\n1. Connect credentials on each node (Google, OpenAI, Slack).\n2. Pick your sheet/folder/channel and model.\n3. Run once with test data and check the output before activating.\nKeep a human check on anything customer-facing.",
    "height": 260,
    "width": 420
   },
   "id": "6b130fde-6aa1-4c7a-8de4-cde2e819efc7",
   "name": "Read me",
   "type": "n8n-nodes-base.stickyNote",
   "typeVersion": 1,
   "position": [
    200,
    20
   ]
  }
 ],
 "connections": {
  "Gmail Trigger": {
   "main": [
    [
     {
      "node": "AI step",
      "type": "main",
      "index": 0
     }
    ]
   ]
  },
  "AI step": {
   "main": [
    [
     {
      "node": "Post to Slack",
      "type": "main",
      "index": 0
     }
    ]
   ]
  }
 },
 "pinData": {},
 "active": false,
 "settings": {
  "executionOrder": "v1"
 },
 "meta": {
  "templateCredsSetupCompleted": false
 },
 "tags": []
}