{
  "name": "Predictive health monitoring & alert system with GPT-4o-mini",
  "nodes": [
    {
      "id": "0c2ded10-be6c-49be-b328-57581a01abf4",
      "name": "Webhook - Health Data Input",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -272,
        1216
      ]
    },
    {
      "id": "5d24fe84-e6a7-40bf-a749-6752838cb715",
      "name": "Normalize Health Data",
      "type": "n8n-nodes-base.code",
      "position": [
        -80,
        1216
      ]
    },
    {
      "id": "a60b0cae-2d85-4c93-8bdc-b819a44d9f77",
      "name": "Store in Database",
      "type": "n8n-nodes-base.postgres",
      "position": [
        144,
        1024
      ]
    },
    {
      "id": "c3d5aa03-7d91-416c-9720-d0ca8c7504cf",
      "name": "Get Recent History",
      "type": "n8n-nodes-base.postgres",
      "position": [
        144,
        1408
      ]
    },
    {
      "id": "a90be109-549c-4cd8-a668-d0354a5c7022",
      "name": "Analyze Health Metrics",
      "type": "n8n-nodes-base.code",
      "position": [
        368,
        1408
      ]
    },
    {
      "id": "06be0728-a5de-429e-80c4-162f63e9f050",
      "name": "Check If Doctor Visit Needed",
      "type": "n8n-nodes-base.if",
      "position": [
        1024,
        1216
      ]
    },
    {
      "id": "0055cd07-1fe3-4482-bd1c-49845434ffa7",
      "name": "Generate Health Report",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1232,
        944
      ]
    },
    {
      "id": "ef5be657-a1d3-40c4-b54d-19bae5a8509a",
      "name": "OpenAI GPT-4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1232,
        1184
      ]
    },
    {
      "id": "0426db19-e07c-4bcc-b48d-905edf59e74f",
      "name": "Send Health Report Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1504,
        1072
      ]
    },
    {
      "id": "1122c278-79e4-40f5-81ca-f0ae59075067",
      "name": "Send Urgent Doctor Alert",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        1680,
        1072
      ]
    },
    {
      "id": "f68c6a66-b9ec-495f-a518-8b6b03055e45",
      "name": "No Action Needed",
      "type": "n8n-nodes-base.noOp",
      "position": [
        1376,
        1360
      ]
    },
    {
      "id": "4a48c63d-7880-4b3e-8eac-6041aab8083b",
      "name": "Emergency Contact SMS Alert",
      "type": "n8n-nodes-base.twilio",
      "position": [
        1024,
        1408
      ]
    },
    {
      "id": "b68af135-b329-4f4c-9622-85313522c5b0",
      "name": "Log to MongoDB Health History",
      "type": "n8n-nodes-base.mongoDb",
      "position": [
        368,
        1024
      ]
    },
    {
      "id": "282eda5f-b9bb-4694-959c-e49129061e85",
      "name": "Calculate Health Score",
      "type": "n8n-nodes-base.code",
      "position": [
        512,
        1232
      ]
    },
    {
      "id": "4dfe63c1-f787-4aae-af1e-85171df75654",
      "name": "Compare with Previous Week",
      "type": "n8n-nodes-base.code",
      "position": [
        736,
        896
      ]
    },
    {
      "id": "717957d5-3bf5-4b29-b387-6380442db2ca",
      "name": "Generate PDF Report",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1008,
        560
      ]
    },
    {
      "id": "3de482ad-942f-4d19-9077-a272a7092e72",
      "name": "Check Critical Threshold",
      "type": "n8n-nodes-base.if",
      "position": [
        752,
        1392
      ]
    },
    {
      "id": "f6d440af-7ddf-4b73-85a1-8bc37d20348b",
      "name": "Slack Alert to Care Team",
      "type": "n8n-nodes-base.slack",
      "position": [
        1024,
        1600
      ]
    },
    {
      "id": "b3823d85-0472-42da-bc44-be434f4245d1",
      "name": "Schedule Follow-up Calendar Event",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        1024,
        1760
      ]
    },
    {
      "id": "740ab316-db84-44eb-ac4e-0fb5b0f72bf2",
      "name": "OpenAI Health Trends Analysis",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1040,
        976
      ]
    },
    {
      "id": "de97eb7e-0a9c-4648-9d73-83edab294d5e",
      "name": "AI Predictive Health Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        960,
        752
      ]
    },
    {
      "id": "4d01f55c-c6ca-4ec7-ae13-311f6df60c6a",
      "name": "Store Health Score in Redis Cache",
      "type": "n8n-nodes-base.redis",
      "position": [
        752,
        1568
      ]
    },
    {
      "id": "7927ddba-2f68-4db9-b6bf-4c10fbc161cc",
      "name": "Trigger Wearable Device Sync",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        144,
        1216
      ]
    },
    {
      "id": "ea7ffeed-3d45-424a-8a0d-698b690428e8",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        496
      ],
      "parameters": {
        "width": 624,
        "height": 480,
        "content": "## How It Works\nThe system collects real-time wearable health data, normalizes it, and uses AI to analyze trends and risk scores. It detects anomalies by comparing with historical patterns and automat"
      }
    },
    {
      "id": "9127a23c-4896-4aad-bff6-7f0cd66e8902",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1296,
        496
      ],
      "parameters": {
        "width": 432,
        "height": 416,
        "content": "## Prerequisites\nWearable API, patient database, GPT-4 key, email SMTP, optional Slack/Twilio, calendar integration.\n\n## Use Cases\nMonitor glucose for diabetics, track elderly vitals/fall risk, assess"
      }
    },
    {
      "id": "a42f6415-8235-4a23-89f4-7cab111ef510",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        416,
        496
      ],
      "parameters": {
        "width": 480,
        "height": 240,
        "content": "## Workflow Steps\nIngest real-time wearable data via webhook, store and standardize it, and use GPT-4 for trend analysis and risk scoring. Monitor metrics against thresholds, trigger SMS, email, or Sl"
      }
    }
  ],
  "connections": {
    "OpenAI GPT-4": {
      "ai_languageModel": [
        [
          {
            "node": "Generate Health Report",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Store in Database": {
      "main": [
        [
          {
            "node": "Log to MongoDB Health History",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Recent History": {
      "main": [
        [
          {
            "node": "Analyze Health Metrics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Health Data": {
      "main": [
        [
          {
            "node": "Store in Database",
            "type": "main",
            "index": 0
          },
          {
            "node": "Get Recent History",
            "type": "main",
            "index": 0
          },
          {
            "node": "Trigger Wearable Device Sync",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Health Metrics": {
      "main": [
        [
          {
            "node": "Check If Doctor Visit Needed",
            "type": "main",
            "index": 0
          },
          {
            "node": "Calculate Health Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Health Score": {
      "main": [
        [
          {
            "node": "Compare with Previous Week",
            "type": "main",
            "index": 0
          },
          {
            "node": "Check Critical Threshold",
            "type": "main",
            "index": 0
          },
          {
            "node": "Store Health Score in Redis Cache",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Health Report": {
      "main": [
        [
          {
            "node": "Send Health Report Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Critical Threshold": {
      "main": [
        [
          {
            "node": "Emergency Contact SMS Alert",
            "type": "main",
            "index": 0
          },
          {
            "node": "Slack Alert to Care Team",
            "type": "main",
            "index": 0
          },
          {
            "node": "Schedule Follow-up Calendar Event",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Health Report Email": {
      "main": [
        [
          {
            "node": "Send Urgent Doctor Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Compare with Previous Week": {
      "main": [
        [
          {
            "node": "Check If Doctor Visit Needed",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Predictive Health Agent",
            "type": "main",
            "index": 0
          },
          {
            "node": "Generate PDF Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - Health Data Input": {
      "main": [
        [
          {
            "node": "Normalize Health Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Doctor Visit Needed": {
      "main": [
        [
          {
            "node": "Generate Health Report",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "No Action Needed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Health Trends Analysis": {
      "ai_languageModel": [
        [
          {
            "node": "AI Predictive Health Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    }
  }
}