{
  "name": "Send AI-generated stale lead nudges from Notion CRM to Telegram with OpenAI",
  "nodes": [
    {
      "id": "647ced92-ba98-4691-bda4-1efcfc88ba67",
      "name": "Run Every Morning",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1632,
        64
      ]
    },
    {
      "id": "044451d8-bc2d-49a7-933e-8e6bd5a35fdf",
      "name": "Manual Trigger",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -1632,
        256
      ]
    },
    {
      "id": "0889c47b-4081-49c4-a028-bda2604c4712",
      "name": "📝 CONFIGURATION",
      "type": "n8n-nodes-base.set",
      "position": [
        -1408,
        160
      ]
    },
    {
      "id": "8a762007-75b0-4d91-8720-3d2dad3bad07",
      "name": "📂 Get Agents",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1056,
        0
      ]
    },
    {
      "id": "50b33a1c-f038-4403-acbf-52f597f278de",
      "name": "📂 Get Active Leads",
      "type": "n8n-nodes-base.notion",
      "position": [
        -1056,
        224
      ]
    },
    {
      "id": "1ba0f77d-5dd5-44aa-a1f3-cfb5aebd4901",
      "name": "🗓️ Filter & Map Agents",
      "type": "n8n-nodes-base.code",
      "position": [
        -752,
        112
      ]
    },
    {
      "id": "69b68f1b-f3bb-4a79-89db-91a3514d9384",
      "name": "🔄 Loop Stale Leads",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -544,
        112
      ]
    },
    {
      "id": "3d54d8cf-3f49-4bc3-9333-9b9c3066ec15",
      "name": "🤖 AI Coach",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -256,
        112
      ]
    },
    {
      "id": "f1a11c9e-3e88-4c80-a1f7-06ded615cabc",
      "name": "📢 Send Nudge",
      "type": "n8n-nodes-base.telegram",
      "position": [
        64,
        112
      ]
    },
    {
      "id": "daf80295-b9fe-449a-90a4-bcc3a0652c26",
      "name": "Sticky Note 1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1472,
        -112
      ],
      "parameters": {
        "width": 260,
        "height": 588,
        "content": "## 1. Setup\nDuplicate the Notion Template first:\n[👉 Get the Template](https://probable-banana-3c9.notion.site/AI-Sales-Coach-System-n8n-Companion-v-1-2ee6bbcb3d0b811694b6d5ab51652670?pvs=143)\n\nThen se"
      }
    },
    {
      "id": "402398e3-dad1-4ef2-ac1d-c5f85c385f28",
      "name": "Sticky Note 2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1168,
        -112
      ],
      "parameters": {
        "width": 313,
        "height": 588,
        "content": "## 2. Data Sources\nFetches your **Agents list** (to find Telegram IDs) and **Active Deals** (to find stale leads)."
      }
    },
    {
      "id": "ca51877e-ae29-487d-9302-8c68240d72aa",
      "name": "Sticky Note 3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -816,
        -16
      ],
      "parameters": {
        "width": 428,
        "height": 356,
        "content": "## 3. Logic Core\nThis code maps Leads to Agents by Email, calculates \"Days Inactive\", and sorts the worst offenders."
      }
    },
    {
      "id": "a121e657-1b58-4193-95fb-cde2acda87b3",
      "name": "Sticky Note 4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -320,
        -16
      ],
      "parameters": {
        "width": 540,
        "height": 352,
        "content": "## 4. AI & Action\nOpenAI writes a custom message based on the deal size and stage. Then sends it via Telegram."
      }
    },
    {
      "id": "64638a0f-c17a-46a0-8e70-2375169cc972",
      "name": "Main Sticky",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2208,
        -112
      ],
      "parameters": {
        "width": 450,
        "height": 450,
        "content": "# 🤖 AI Sales Coach\nThis workflow acts as a relentless but helpful sales manager. It wakes up every morning, scans your Notion CRM for leads that haven't been touched in X days, and uses AI to generate"
      }
    }
  ],
  "connections": {
    "🤖 AI Coach": {
      "main": [
        [
          {
            "node": "📢 Send Nudge",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Manual Trigger": {
      "main": [
        [
          {
            "node": "📝 CONFIGURATION",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📂 Get Agents": {
      "main": [
        [
          {
            "node": "📂 Get Active Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📢 Send Nudge": {
      "main": [
        [
          {
            "node": "🔄 Loop Stale Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Every Morning": {
      "main": [
        [
          {
            "node": "📝 CONFIGURATION",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📝 CONFIGURATION": {
      "main": [
        [
          {
            "node": "📂 Get Agents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "📂 Get Active Leads": {
      "main": [
        [
          {
            "node": "🗓️ Filter & Map Agents",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🔄 Loop Stale Leads": {
      "main": [
        [],
        [
          {
            "node": "🤖 AI Coach",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "🗓️ Filter & Map Agents": {
      "main": [
        [
          {
            "node": "🔄 Loop Stale Leads",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}