{
  "name": "Triage emergency patients via chat with GPT-4.1 and hospital systems",
  "nodes": [
    {
      "id": "52567a22-dcf7-4f45-af46-13cadfb5271d",
      "name": "Patient Chat Interface",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -2544,
        440
      ]
    },
    {
      "id": "037366e6-4628-44e4-87c5-7de3beef4e5a",
      "name": "Hospital Triage Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -2072,
        440
      ]
    },
    {
      "id": "4a2e7736-fc41-4fd5-8221-b4078489945e",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2192,
        640
      ]
    },
    {
      "id": "5cb66d96-c4df-4d7a-8804-00f7bcdcba08",
      "name": "Conversation Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -2472,
        664
      ]
    },
    {
      "id": "102c4636-0665-42dd-9d02-4497d70d4d4d",
      "name": "Structured JSON Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        -1728,
        656
      ]
    },
    {
      "id": "9fc5ee3d-3dd8-46ac-969a-5b954665d1b8",
      "name": "Check Action Required",
      "type": "n8n-nodes-base.if",
      "position": [
        -256,
        472
      ]
    },
    {
      "id": "806c8ec0-f110-4024-ac18-173fce2616e5",
      "name": "Execute Appointment Action",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -32,
        400
      ]
    },
    {
      "id": "0a225977-e5ac-4f29-bfe7-ef3b8006bd4c",
      "name": "Send Notification",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        192,
        400
      ]
    },
    {
      "id": "95d2795e-2307-413a-bf2d-22d17b14c36c",
      "name": "Format Response to Patient",
      "type": "n8n-nodes-base.set",
      "position": [
        416,
        544
      ]
    },
    {
      "id": "ef757065-a9a2-477c-a4c1-6a289e7f40b5",
      "name": "Route by Intent Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        640,
        496
      ]
    },
    {
      "id": "33b463ec-fdf8-4b1e-aeb4-e28afa518c83",
      "name": "Log Interaction to Audit DB",
      "type": "n8n-nodes-base.postgres",
      "position": [
        976,
        480
      ]
    },
    {
      "id": "831a8468-820c-44c5-af50-418d9d829db6",
      "name": "Check Patient Eligibility",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -704,
        472
      ]
    },
    {
      "id": "e2631759-4fba-4b51-8ed2-316c698abb52",
      "name": "Retrieve Patient History",
      "type": "n8n-nodes-base.postgres",
      "position": [
        -1376,
        472
      ]
    },
    {
      "id": "6ada8fb5-cdf9-4073-b889-57b22a1cec5b",
      "name": "Calculate Priority Score",
      "type": "n8n-nodes-base.code",
      "position": [
        -480,
        472
      ]
    },
    {
      "id": "1c44a703-f381-428a-8cfb-a75552378bf3",
      "name": "Validate Business Rules",
      "type": "n8n-nodes-base.code",
      "position": [
        -928,
        472
      ]
    },
    {
      "id": "03007106-8bae-4192-b988-6dc69f5e9896",
      "name": "Department Availability Checker Tool",
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "position": [
        -2064,
        664
      ]
    },
    {
      "id": "43b5a0f0-8064-4cc0-80ad-824d7dd2cde6",
      "name": "Patient Consent Validator Tool",
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "position": [
        -1888,
        672
      ]
    },
    {
      "id": "5dd16f89-ed14-45f9-9086-ee8a1cb000d7",
      "name": "Check Confidence Threshold",
      "type": "n8n-nodes-base.if",
      "position": [
        -1568,
        560
      ]
    },
    {
      "id": "ff21d9c1-3e1d-49af-8b88-66ab86f60c48",
      "name": "Enrich with Patient Context",
      "type": "n8n-nodes-base.set",
      "position": [
        -1152,
        472
      ]
    },
    {
      "id": "ed3a2c66-996d-45d7-8f11-6424d6540a5a",
      "name": "Prepare Escalation Data",
      "type": "n8n-nodes-base.set",
      "position": [
        192,
        688
      ]
    },
    {
      "id": "039f7794-c651-42b6-98f4-62a83c7080fa",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1584,
        -32
      ],
      "parameters": {
        "width": 688,
        "height": 304,
        "content": "## Prerequisites\nActive OpenAI API account, hospital system API access for appointments and notifications\n## Use Cases\nEmergency department patient intake, urgent care prioritization, virtual triage f"
      }
    },
    {
      "id": "32b560ff-ee49-4eb9-9342-fcf4cdb945a9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2112,
        -16
      ],
      "parameters": {
        "width": 480,
        "height": 288,
        "content": "\n## Setup Steps\n1. Configure OpenAI credentials with API key for AI agent access\n2. Set up Hospital Triage Agent node with your clinical triage protocols\n3. Configure Patient Consent and Structured JS"
      }
    },
    {
      "id": "86b3d08b-6ce4-46b5-88e3-fbb27cfd73c6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2720,
        -64
      ],
      "parameters": {
        "width": 592,
        "height": 336,
        "content": "## How It Works\nThis workflow automates hospital emergency department triage by intelligently processing patient intake information through multiple AI-powered assessment stages. Designed for emergenc"
      }
    },
    {
      "id": "6943f600-7e88-42c0-924b-e5d47ba0b66a",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        320
      ],
      "parameters": {
        "width": 1712,
        "height": 528,
        "content": "## Priority Calculation and Care Routing\n**Why:** Computes urgency scores based on assessment data, determines appropriate care pathways (immediate, urgent, standard), triggers notifications to assign"
      }
    },
    {
      "id": "4ed9945f-c53f-45ef-a05e-3af7ad1f6fc5",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2224,
        304
      ],
      "parameters": {
        "width": 1664,
        "height": 560,
        "content": "## Multi-Agent AI Medical Assessment\n**Why:** Analyzes patient data through specialized AI models including OpenAI for symptom interpretation, structured JSON checkers for protocol validation, and sta"
      }
    },
    {
      "id": "f2185f43-a8b1-46db-a525-2999bf87722b",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2736,
        304
      ],
      "parameters": {
        "width": 496,
        "height": 544,
        "content": "## Patient Data Collection via Chat Interface\n**Why:** Captures initial symptoms, medical history, and vital signs through conversational interface, reducing intake time while gathering comprehensive "
      }
    }
  ],
  "connections": {
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Hospital Triage Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Send Notification": {
      "main": [
        [
          {
            "node": "Format Response to Patient",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Conversation Memory": {
      "ai_memory": [
        [
          {
            "node": "Hospital Triage Agent",
            "type": "ai_memory",
            "index": 0
          },
          {
            "node": "Patient Chat Interface",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Route by Intent Type": {
      "main": [
        [
          {
            "node": "Log Interaction to Audit DB",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Action Required": {
      "main": [
        [
          {
            "node": "Execute Appointment Action",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format Response to Patient",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Hospital Triage Agent": {
      "main": [
        [
          {
            "node": "Check Confidence Threshold",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Patient Chat Interface": {
      "main": [
        [
          {
            "node": "Hospital Triage Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Escalation Data": {
      "main": [
        [
          {
            "node": "Format Response to Patient",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Business Rules": {
      "main": [
        [
          {
            "node": "Check Patient Eligibility",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Priority Score": {
      "main": [
        [
          {
            "node": "Check Action Required",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Retrieve Patient History": {
      "main": [
        [
          {
            "node": "Enrich with Patient Context",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Patient Eligibility": {
      "main": [
        [
          {
            "node": "Calculate Priority Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Confidence Threshold": {
      "main": [
        [
          {
            "node": "Retrieve Patient History",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Prepare Escalation Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Appointment Action": {
      "main": [
        [
          {
            "node": "Send Notification",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Response to Patient": {
      "main": [
        [
          {
            "node": "Route by Intent Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Enrich with Patient Context": {
      "main": [
        [
          {
            "node": "Validate Business Rules",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured JSON Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Hospital Triage Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Patient Consent Validator Tool": {
      "ai_tool": [
        [
          {
            "node": "Hospital Triage Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Department Availability Checker Tool": {
      "ai_tool": [
        [
          {
            "node": "Hospital Triage Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}