{
  "name": "Send personalized daily learning emails for women using GPT-4o and Gmail",
  "nodes": [
    {
      "id": "e05da8b9-13c1-452f-8ca7-77f87d656e7c",
      "name": "Fetch All Subscribers",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -1184,
        640
      ]
    },
    {
      "id": "d344c966-709a-46a1-a7f8-9e43c7be44ee",
      "name": "Fetch Content Library",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -736,
        640
      ]
    },
    {
      "id": "f7cb081e-4537-42ea-ab23-7a793295df84",
      "name": "Daily 9AM Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -1408,
        640
      ]
    },
    {
      "id": "99c71da5-c251-49dd-b6e1-43814c90b433",
      "name": "Calculate Day, Week & Phase",
      "type": "n8n-nodes-base.code",
      "position": [
        -960,
        640
      ]
    },
    {
      "id": "e09a85e1-9d33-4300-b7e8-6bd6194f8b33",
      "name": "Match Subscriber to Lesson",
      "type": "n8n-nodes-base.code",
      "position": [
        -432,
        640
      ]
    },
    {
      "id": "3f8d5ce6-0ad6-4a80-a090-7fe2fab98f0e",
      "name": "Loop Each Subscriber",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -160,
        640
      ]
    },
    {
      "id": "1e18d082-3e42-4183-9f90-5094934e4004",
      "name": "Personalize Lesson",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        128,
        672
      ]
    },
    {
      "id": "d515c2be-1102-4b3c-8489-bda06b41211e",
      "name": "Build Personalized Email",
      "type": "n8n-nodes-base.code",
      "position": [
        496,
        672
      ]
    },
    {
      "id": "f34518d8-6ca2-4c67-8b5e-732105b8a0dd",
      "name": "Send Daily Lesson Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        768,
        656
      ]
    },
    {
      "id": "b5d3bb5e-89e8-4ed7-8c82-f8b4b4a27b50",
      "name": "Log Delivery to Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1056,
        656
      ]
    },
    {
      "id": "3637002e-952e-4b04-bc4f-cd04b45e5c58",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1968,
        -32
      ],
      "parameters": {
        "width": 384,
        "height": 640,
        "content": "## Workflow Overview\n\nEvery woman learns differently. This workflow sends \na fully personalized daily lesson to every subscriber \nbased on their topic interest and how long they've \nbeen learning — Be"
      }
    },
    {
      "id": "b8342781-1c8c-4e11-8abe-a6bdde4a2319",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1440,
        496
      ],
      "parameters": {
        "width": 864,
        "height": 336,
        "content": "Runs daily at 9AM. Fetches all subscribers and the full content library. Calculates each subscriber's day number, week number, and learning phase based on how long they've been subscribed."
      }
    },
    {
      "id": "b604a044-6e3f-4b12-8e52-edc3c224beb7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        464
      ],
      "parameters": {
        "width": 928,
        "height": 416,
        "content": "Matches each subscriber to the best lesson based on topic interest and phase. Loops one by one and sends each profile to GPT-4o which generates a personalized lesson, task, takeaways, and a motivation"
      }
    },
    {
      "id": "3e373758-e0b5-4262-9290-3240e7c21762",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        512
      ],
      "parameters": {
        "width": 832,
        "height": 384,
        "content": "Builds a branded HTML email with all AI generated content and sends it to each subscriber via Gmail. Every delivery is logged to the SendLog sheet with date, name, lesson title, phase, and AI snippet."
      }
    }
  ],
  "connections": {
    "Daily 9AM Trigger": {
      "main": [
        [
          {
            "node": "Fetch All Subscribers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Personalize Lesson": {
      "main": [
        [
          {
            "node": "Build Personalized Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Each Subscriber": {
      "main": [
        [],
        [
          {
            "node": "Personalize Lesson",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch All Subscribers": {
      "main": [
        [
          {
            "node": "Calculate Day, Week & Phase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Content Library": {
      "main": [
        [
          {
            "node": "Match Subscriber to Lesson",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Delivery to Sheets": {
      "main": [
        [
          {
            "node": "Loop Each Subscriber",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Daily Lesson Email": {
      "main": [
        [
          {
            "node": "Log Delivery to Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Personalized Email": {
      "main": [
        [
          {
            "node": "Send Daily Lesson Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Match Subscriber to Lesson": {
      "main": [
        [
          {
            "node": "Loop Each Subscriber",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Day, Week & Phase": {
      "main": [
        [
          {
            "node": "Fetch Content Library",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}