{
  "name": "Send weekly personalized pet health tips with GPT-4o-mini, Gmail and Google Sheets",
  "nodes": [
    {
      "id": "a1cb38ea-5319-4042-84e6-caad7bd27e8f",
      "name": "Generate Personalized Tip",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1328,
        80
      ]
    },
    {
      "id": "1703951c-551a-4f84-9aad-3d1a1fec6144",
      "name": "No Operation, do nothing",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1104,
        -112
      ]
    },
    {
      "id": "b454fd2e-7690-45a8-9bd1-f30138c822c8",
      "name": "Calculate Pet Age",
      "type": "n8n-nodes-base.code",
      "position": [
        1104,
        80
      ]
    },
    {
      "id": "1ab3dd7f-bb4a-4c00-b21f-7df710e66a67",
      "name": "Send Health Tip using Gmail",
      "type": "n8n-nodes-base.gmail",
      "position": [
        1904,
        80
      ]
    },
    {
      "id": "d68799f3-e768-4139-b8d9-68fc1fd9a657",
      "name": "Weekly Trigger (Mondays 9am)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        208,
        80
      ]
    },
    {
      "id": "0aaeebf6-69fb-4acd-a70a-2920d3188345",
      "name": "Filter: Active + 7-Day Check",
      "type": "n8n-nodes-base.code",
      "position": [
        656,
        80
      ]
    },
    {
      "id": "b74fedec-acdf-400d-b2e7-0b9aab4f3044",
      "name": "Process Pets One-by-One",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        880,
        80
      ]
    },
    {
      "id": "ca404c94-1c4b-4a42-b2e2-b244c3e66873",
      "name": "Format Email Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1680,
        80
      ]
    },
    {
      "id": "4d490b67-69ff-453d-9916-fd9ad3a43c2e",
      "name": "Send via SendGrid (Disabled)",
      "type": "n8n-nodes-base.sendGrid",
      "position": [
        1888,
        -144
      ]
    },
    {
      "id": "5875181b-6e58-46e6-9c48-569e6aad9130",
      "name": "Update Last_Email_Sent Date",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2128,
        80
      ]
    },
    {
      "id": "0dc11fbc-448d-467e-8957-82887556d9bd",
      "name": "Log to Email_Log Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2352,
        80
      ]
    },
    {
      "id": "6a2afbfa-bc25-4776-921a-dd639b634c7a",
      "name": "Wait 2 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        2704,
        304
      ]
    },
    {
      "id": "011414fc-c326-4cd7-b5af-b00d986b1608",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        -64
      ],
      "parameters": {
        "width": 864,
        "height": 544,
        "content": "## Sends AI-generated, location & age-specific health tips to pet owners every week.\n\n\n### HOW IT WORKS:\n1. Loads active pets from Google Sheets\n2. Filters pets who haven't received email in 7+ days\n3"
      }
    },
    {
      "id": "92430d38-0a38-4b96-8a72-7517f16f5baa",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        272
      ],
      "parameters": {
        "width": 192,
        "height": 112,
        "content": "**Loads all rows where Status = \"Active\"**\n\nFilters applied: Status column"
      }
    },
    {
      "id": "59a432e6-2f31-4919-a7fd-908aeb2948ff",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        624,
        256
      ],
      "parameters": {
        "width": 224,
        "height": 208,
        "content": " **Skips if:**\n- Status ≠ \"Active\"\n- Last_Email_Sent < 7 days ago\n\n **Includes if:**\n- Never emailed (empty field)\n- Last email >7 days old\n\n \n"
      }
    },
    {
      "id": "0927faad-6699-41f3-9082-9133f85a9111",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        224
      ],
      "parameters": {
        "width": 288,
        "height": 192,
        "content": "**Converts Date_of_Birth to readable age:**\n\n- <12mo: \"8 months\"\n- 12+mo: \"2 years and 3 months\"\n- Exact: \"5 years\"\n\n\nAdds: pet_age, pet_age_months\n\n"
      }
    },
    {
      "id": "daeda379-8395-4133-b7f5-cf4254129b27",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1360,
        224
      ],
      "parameters": {
        "width": 304,
        "height": 208,
        "content": "**Climate-specific advice based on:**\n\n- Pet type (Dog/Cat)\n- Age in months\n- Country (hemisphere + season)\n- Current date\n\nReturns JSON: topic, headline, content, category"
      }
    },
    {
      "id": "628e8125-7d58-4841-89a1-7460bbb7cc2b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2160,
        288
      ],
      "parameters": {
        "width": 304,
        "height": 192,
        "content": "Updates: Last_Email_Sent = current timestamp\nMatches on: Email column"
      }
    },
    {
      "id": "136e8aa3-f5d8-4786-8e00-08d25bb7cef3",
      "name": "Load Pet Info",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        432,
        80
      ]
    }
  ],
  "connections": {
    "Load Pet Info": {
      "main": [
        [
          {
            "node": "Filter: Active + 7-Day Check",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 2 Seconds": {
      "main": [
        [
          {
            "node": "Process Pets One-by-One",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Pet Age": {
      "main": [
        [
          {
            "node": "Generate Personalized Tip",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Email Data": {
      "main": [
        [
          {
            "node": "Send via SendGrid (Disabled)",
            "type": "main",
            "index": 0
          },
          {
            "node": "Send Health Tip using Gmail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log to Email_Log Sheet": {
      "main": [
        [
          {
            "node": "Wait 2 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Pets One-by-One": {
      "main": [
        [
          {
            "node": "No Operation, do nothing",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Calculate Pet Age",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Personalized Tip": {
      "main": [
        [
          {
            "node": "Format Email Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Health Tip using Gmail": {
      "main": [
        [
          {
            "node": "Update Last_Email_Sent Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Last_Email_Sent Date": {
      "main": [
        [
          {
            "node": "Log to Email_Log Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter: Active + 7-Day Check": {
      "main": [
        [
          {
            "node": "Process Pets One-by-One",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send via SendGrid (Disabled)": {
      "main": [
        [
          {
            "node": "Update Last_Email_Sent Date",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Weekly Trigger (Mondays 9am)": {
      "main": [
        [
          {
            "node": "Load Pet Info",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}