{
  "name": "Automate patient intake and AI risk triage with Azure OpenAI, Google, and Slack",
  "nodes": [
    {
      "id": "224e8bd7-da15-41e6-bff2-9f2cd35ad0e2",
      "name": "📋 Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        960
      ],
      "parameters": {
        "width": 560,
        "height": 764,
        "content": "## 🏥 Patient Pre-Arrival Intake Automation\n\n### How it works\nThis workflow automates two parallel healthcare processes:\n\n**Branch 1 — Appointment Reminders:** Every hour, the workflow fetches upcoming"
      }
    },
    {
      "id": "0b3adea4-5c18-4f14-abc6-a06c53f44d40",
      "name": "Section: Appointment Reminder",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        752
      ],
      "parameters": {
        "width": 640,
        "height": 200,
        "content": "## 📅 Appointment Reminder Branch\nRuns every hour. Fetches all upcoming appointments from Google Calendar and sends each patient a pre-arrival intake email via Gmail to collect symptoms and medical his"
      }
    },
    {
      "id": "32f3c2ca-770e-492e-80f2-5a6c4fcc8f83",
      "name": "Section: Intake & AI Analysis",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -560,
        1200
      ],
      "parameters": {
        "width": 840,
        "height": 164,
        "content": "## 🤖 Patient Intake & AI Risk Analysis\nTriggered on new form responses. Azure OpenAI analyses symptoms, allergies, and visit reason, returning a structured risk assessment with level, flags, confidenc"
      }
    },
    {
      "id": "5b7d9a72-86d5-4f4f-829e-e785d8baea99",
      "name": "Section: Risk Triage & Notification",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        1168
      ],
      "parameters": {
        "width": 728,
        "height": 200,
        "content": "## 📊 Risk Triage & Doctor Notification\nStores the AI assessment back into Google Sheets (Sheet1). Checks if risk level is **High** — if so, fires an instant Slack alert to the assigned doctor with pat"
      }
    },
    {
      "id": "72b9461a-1344-4776-be3f-591f0fa34fc0",
      "name": "⚠️ Warning: Slack Config",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        1120
      ],
      "parameters": {
        "width": 260,
        "height": 150,
        "content": "⚠️ **Slack Credentials Required**\nReplace `YOUR_SLACK_CHANNEL` with a valid channel ID. Ensure the Slack OAuth2 app has `chat:write` scope. Missing config will silently skip high-risk alerts."
      }
    },
    {
      "id": "499ecd67-0dec-435e-b8ed-9597c9f505a6",
      "name": "⚠️ Warning: Azure OpenAI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        1600
      ],
      "parameters": {
        "width": 260,
        "height": 150,
        "content": "⚠️ **Azure OpenAI Credentials Required**\nThis node requires a valid Azure OpenAI API key and an active `gpt-4o-mini` deployment. Incorrect credentials will halt the entire intake assessment pipeline."
      }
    },
    {
      "id": "6842f180-285d-479e-984b-55cf24da4504",
      "name": "Hourly Schedule Trigger",
      "type": "n8n-nodes-base.cron",
      "position": [
        -464,
        976
      ]
    },
    {
      "id": "08efb4fc-5703-46db-b1ac-74867e649721",
      "name": "Fetch Calendar Appointments",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -272,
        976
      ]
    },
    {
      "id": "0d89988a-05ce-40b6-bc0b-06a3cd6a7710",
      "name": "Send Pre-Arrival Intake Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -64,
        976
      ]
    },
    {
      "id": "277a99af-7589-4e66-bf3b-85eec473dfb7",
      "name": "Watch Intake Form Responses",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -480,
        1408
      ]
    },
    {
      "id": "9714372f-79a8-4b4f-b1f0-63bd4411e1ca",
      "name": "AI Risk Assessment Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -224,
        1408
      ]
    },
    {
      "id": "0a997b53-5985-4e77-8b19-d576d59a2cd0",
      "name": "Normalize AI Output",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        1408
      ]
    },
    {
      "id": "086887e7-d121-4df3-9fe1-f3a658eb302d",
      "name": "Save Assessment to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        448,
        1408
      ]
    },
    {
      "id": "d5c63f4f-864a-4a00-88a8-b4b8813035d9",
      "name": "Check Risk Level",
      "type": "n8n-nodes-base.if",
      "position": [
        768,
        1408
      ]
    },
    {
      "id": "ffbd555a-5222-4104-b291-e3dbd0afb371",
      "name": "Notify Doctor via Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1232,
        1328
      ]
    },
    {
      "id": "4bdc07e3-b2ea-4e74-831e-98cc4020abb8",
      "name": "Azure OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        -416,
        1616
      ]
    }
  ],
  "connections": {
    "Check Risk Level": {
      "main": [
        [
          {
            "node": "Notify Doctor via Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize AI Output": {
      "main": [
        [
          {
            "node": "Save Assessment to Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hourly Schedule Trigger": {
      "main": [
        [
          {
            "node": "Fetch Calendar Appointments",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Risk Assessment Agent": {
      "main": [
        [
          {
            "node": "Normalize AI Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Azure OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "AI Risk Assessment Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Save Assessment to Sheet": {
      "main": [
        [
          {
            "node": "Check Risk Level",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Calendar Appointments": {
      "main": [
        [
          {
            "node": "Send Pre-Arrival Intake Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Watch Intake Form Responses": {
      "main": [
        [
          {
            "node": "AI Risk Assessment Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}