{
  "id": "Hfgi2CCr6lJjOmUd",
  "name": "Hospital Operations and Patient Care Orchestration Agent",
  "tags": [],
  "nodes": [
    {
      "id": "4e74c12e-a822-427d-904c-848a5cc6ed78",
      "name": "Hospital Event Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -704,
        960
      ],
      "parameters": {
        "path": "hospital-orchestration",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "lastNode"
      },
      "typeVersion": 2.1
    },
    {
      "id": "67ee9fa6-5fec-4405-9857-9acb34a87efb",
      "name": "Workflow Configuration",
      "type": "n8n-nodes-base.set",
      "position": [
        -480,
        960
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "id-1",
              "name": "dischargeReadinessThreshold",
              "type": "number",
              "value": 0.85
            },
            {
              "id": "id-2",
              "name": "taskPriorityWeightUrgency",
              "type": "number",
              "value": 0.4
            },
            {
              "id": "id-3",
              "name": "taskPriorityWeightWorkload",
              "type": "number",
              "value": 0.3
            },
            {
              "id": "id-4",
              "name": "taskPriorityWeightSkillMatch",
              "type": "number",
              "value": 0.3
            },
            {
              "id": "id-5",
              "name": "followUpWindowDays",
              "type": "number",
              "value": 7
            },
            {
              "id": "id-6",
              "name": "medicationReminderHours",
              "type": "number",
              "value": 24
            },
            {
              "id": "id-7",
              "name": "complianceAuditEnabled",
              "type": "boolean",
              "value": true
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "49872a34-8160-466d-b794-2c49420cd854",
      "name": "Hospital Orchestration Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -144,
        960
      ],
      "parameters": {
        "text": "={{ $json }}",
        "options": {
          "systemMessage": "=You are an AI orchestration agent embedded in a hospital workflow system responsible for coordinating end-to-end operational, administrative, and patient experience processes.\n\n## YOUR CORE RESPONSIBILITIES:\n\n### 1. DISCHARGE READINESS & PATIENT CARE COORDINATION\n- Validate discharge readiness signals using the threshold: {{ $('Workflow Configuration').first().json.dischargeReadinessThreshold }}\n- Coordinate follow-up appointments within {{ $('Workflow Configuration').first().json.followUpWindowDays }} days post-discharge\n- Schedule post-discharge communications and medication reminders (every {{ $('Workflow Configuration').first().json.medicationReminderHours }} hours)\n- Initiate community care referrals when needed\n- Detect and flag missed follow-ups or service gaps\n\n### 2. BILLING & INSURANCE PRE-AUTHORIZATION\n- Interpret insurance pre-authorization requests\n- Validate patient eligibility and required documents\n- Sequence approval workflows and handle partial approvals or expirations\n- Trigger reminders or escalations for pending authorizations\n- Mask sensitive financial identifiers (PII/PHI) in all outputs\n- Ensure HIPAA compliance in all billing-related communications\n\n### 3. DYNAMIC TASK ASSIGNMENT & PRIORITIZATION\n- Assign and reprioritize non-clinical tasks based on:\n  * Staff availability and current workload\n  * Skill set matching (weight: {{ $('Workflow Configuration').first().json.taskPriorityWeightSkillMatch }})\n  * Operational urgency (weight: {{ $('Workflow Configuration').first().json.taskPriorityWeightUrgency }})\n  * Workload balance (weight: {{ $('Workflow Configuration').first().json.taskPriorityWeightWorkload }})\n- Anticipate staffing gaps and trigger proactive notifications\n- Initiate reassignment workflows when staff becomes unavailable\n\n### 4. PATIENT FEEDBACK & OPERATIONAL ANALYTICS\n- Aggregate patient feedback and service interaction data\n- Perform multi-level categorization of events and trends\n- Detect workflow correlations and operational patterns\n- Initiate corrective actions based on trend analysis\n- Generate insights for quality improvement\n\n### 5. COMPLIANCE & RISK MANAGEMENT\n- Enforce consent, privacy, and HIPAA compliance rules\n- Detect risk patterns: missed follow-ups, service gaps, consent violations\n- Maintain audit-ready metadata for all decisions\n- Flag high-risk scenarios for human review\n- Never perform clinical judgment or medical decision-making\n\n## OUTPUT REQUIREMENTS:\n\nYou MUST return structured JSON with ALL of the following fields:\n- workflow_state: Current execution state\n- intent: Identified intent from the input\n- entities: Extracted IDs and relevant data\n- action_required: Next downstream action\n- message_to_patient_or_staff: Human-readable communication\n- audit_metadata: Timestamp, event type, compliance flags\n- confidence_level: Decision confidence (0-1)\n- risk_flags: Array of detected risks\n- task_assignments: Staff assignments with priority scores\n- follow_up_actions: Scheduled follow-ups and reminders\n\n## CRITICAL RULES:\n- NO clinical judgment or medical advice\n- ALWAYS mask PII/PHI in outputs\n- ALWAYS include audit metadata\n- ALWAYS flag risks and compliance issues\n- Be deterministic and consistent in decision-making\n- Prioritize patient safety and operational efficiency"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 3.1
    },
    {
      "id": "db8f4d9f-4613-4c57-9a78-37ae4fc9d5b1",
      "name": "Anthropic Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
      "position": [
        -256,
        1184
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "id",
          "value": "claude-3-5-sonnet-20241022"
        },
        "options": {}
      },
      "credentials": {
        "anthropicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.3
    },
    {
      "id": "cb97fe25-9f7a-4b25-b9aa-fd0026039a85",
      "name": "Structured Output Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        128,
        1184
      ],
      "parameters": {
        "schemaType": "manual",
        "inputSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"workflow_state\": {\n      \"type\": \"string\",\n      \"description\": \"Current state of the workflow execution\"\n    },\n    \"intent\": {\n      \"type\": \"string\",\n      \"description\": \"Identified intent from the input event\"\n    },\n    \"entities\": {\n      \"type\": \"object\",\n      \"description\": \"Extracted entities including patient_id, staff_id, appointment_id, task_id, insurance_request_id, etc.\"\n    },\n    \"action_required\": {\n      \"type\": \"string\",\n      \"description\": \"Next action to be taken by downstream systems\"\n    },\n    \"message_to_patient_or_staff\": {\n      \"type\": \"string\",\n      \"description\": \"Human-readable message for patient or staff communication\"\n    },\n    \"audit_metadata\": {\n      \"type\": \"object\",\n      \"description\": \"Audit trail information including timestamp, user_id, event_type, compliance_flags\"\n    },\n    \"confidence_level\": {\n      \"type\": \"number\",\n      \"description\": \"Confidence score between 0 and 1 for the decision\"\n    },\n    \"risk_flags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"description\": \"Detected risk patterns such as missed_followup, service_gap, consent_violation\"\n    },\n    \"task_assignments\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\"\n      },\n      \"description\": \"Task assignments with staff_id, task_id, priority_score, skill_match\"\n    },\n    \"follow_up_actions\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"object\"\n      },\n      \"description\": \"Follow-up actions including type, scheduled_date, recipient, reminder_sent\"\n    }\n  }\n}"
      },
      "typeVersion": 1.3
    },
    {
      "id": "d0951e3c-06dd-46cc-947b-57650bf8b0b2",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        368,
        1296
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={{ $json.output }}"
      },
      "typeVersion": 1.5
    },
    {
      "id": "b79fb953-d885-4674-9de7-acfb0f337e8c",
      "name": "Route by Action Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        368,
        1040
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Schedule Appointment",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.output.action_required }}",
                    "rightValue": "schedule_appointment"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Verify Insurance",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.output.action_required }}",
                    "rightValue": "verify_insurance"
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "Assign Task",
              "conditions": {
                "options": {
                  "leftValue": "",
                  "caseSensitive": false,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "operator": {
                      "type": "string",
                      "operation": "contains"
                    },
                    "leftValue": "={{ $json.output.action_required }}",
                    "rightValue": "assign_task"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {
          "fallbackOutput": "extra",
          "renameFallbackOutput": "Other Actions"
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "bd61d7fa-620a-4823-8972-1d087a5cf3c8",
      "name": "Schedule Appointment API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        816,
        912
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Appointment scheduling API endpoint__>",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ $json.output.follow_up_actions }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "5f4e6e5c-b896-4807-83e8-9c6984a9ffd6",
      "name": "Insurance Verification API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        816,
        1344
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Insurance verification API endpoint__>",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ $json.output.entities }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "f34a1047-c880-4f55-b716-9f9b393b68dd",
      "name": "Task Management API",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        624,
        1136
      ],
      "parameters": {
        "url": "<__PLACEHOLDER_VALUE__Task management API endpoint__>",
        "method": "POST",
        "options": {},
        "jsonBody": "={{ $json.output.task_assignments }}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        }
      },
      "typeVersion": 4.3
    },
    {
      "id": "f31c396a-50fb-4599-8e0e-458a70cfe712",
      "name": "Calculate Task Priority Score",
      "type": "n8n-nodes-base.code",
      "position": [
        816,
        1136
      ],
      "parameters": {
        "mode": "runOnceForEachItem",
        "jsCode": "// Calculate Task Priority Score using weighted formula from Workflow Configuration\n\n// Access configuration weights\nconst config = $('Workflow Configuration').first().json;\nconst urgencyWeight = config.taskPriorityWeightUrgency;\nconst workloadWeight = config.taskPriorityWeightWorkload;\nconst skillMatchWeight = config.taskPriorityWeightSkillMatch;\n\n// Get current item data\nconst taskAssignments = $input.item.json.task_assignments || [];\n\n// Calculate priority scores for each task assignment\nconst enrichedAssignments = taskAssignments.map(task => {\n  // Extract task metrics (normalize to 0-1 scale if needed)\n  const urgency = task.urgency || 0;\n  const workload = task.workload || 0;\n  const skillMatch = task.skill_match || 0;\n  \n  // Calculate weighted priority score\n  const priorityScore = (\n    (urgency * urgencyWeight) +\n    (workload * workloadWeight) +\n    (skillMatch * skillMatchWeight)\n  );\n  \n  // Return enriched task with calculated priority score\n  return {\n    ...task,\n    priority_score: Math.round(priorityScore * 1000) / 1000, // Round to 3 decimal places\n    calculation_metadata: {\n      urgency_weight: urgencyWeight,\n      workload_weight: workloadWeight,\n      skill_match_weight: skillMatchWeight,\n      calculated_at: new Date().toISOString()\n    }\n  };\n});\n\n// Return the item with enriched task assignments\nreturn {\n  json: {\n    ...$input.item.json,\n    task_assignments: enrichedAssignments,\n    priority_calculation_complete: true\n  }\n};"
      },
      "typeVersion": 2
    },
    {
      "id": "2566d583-12ee-48a2-9da3-10db1d995f6f",
      "name": "Mask PII and PHI Data",
      "type": "n8n-nodes-base.code",
      "position": [
        1264,
        976
      ],
      "parameters": {
        "jsCode": "// Mask PII and PHI Data\n// This code sanitizes sensitive information while preserving data structure\n\nconst crypto = require('crypto');\n\n// Helper function to hash sensitive data\nfunction hashValue(value) {\n  if (!value) return value;\n  return crypto.createHash('sha256').update(String(value)).digest('hex').substring(0, 16);\n}\n\n// Helper function to mask SSN (XXX-XX-1234)\nfunction maskSSN(ssn) {\n  if (!ssn) return ssn;\n  const cleaned = String(ssn).replace(/\\D/g, '');\n  if (cleaned.length === 9) {\n    return `XXX-XX-${cleaned.substring(5)}`;\n  }\n  return 'XXX-XX-XXXX';\n}\n\n// Helper function to mask credit card (XXXX-XXXX-XXXX-1234)\nfunction maskCreditCard(cc) {\n  if (!cc) return cc;\n  const cleaned = String(cc).replace(/\\D/g, '');\n  if (cleaned.length >= 13 && cleaned.length <= 16) {\n    return `XXXX-XXXX-XXXX-${cleaned.substring(cleaned.length - 4)}`;\n  }\n  return 'XXXX-XXXX-XXXX-XXXX';\n}\n\n// Helper function to mask patient names\nfunction maskName(name) {\n  if (!name) return name;\n  const parts = String(name).split(' ');\n  return parts.map(part => {\n    if (part.length <= 1) return part;\n    return part[0] + '*'.repeat(part.length - 1);\n  }).join(' ');\n}\n\n// Helper function to recursively sanitize objects\nfunction sanitizeObject(obj) {\n  if (obj === null || obj === undefined) return obj;\n  \n  if (Array.isArray(obj)) {\n    return obj.map(item => sanitizeObject(item));\n  }\n  \n  if (typeof obj === 'object') {\n    const sanitized = {};\n    \n    for (const [key, value] of Object.entries(obj)) {\n      const lowerKey = key.toLowerCase();\n      \n      // Mask SSN fields\n      if (lowerKey.includes('ssn') || lowerKey.includes('social_security')) {\n        sanitized[key] = maskSSN(value);\n      }\n      // Mask credit card fields\n      else if (lowerKey.includes('credit_card') || lowerKey.includes('card_number') || lowerKey.includes('cc_number')) {\n        sanitized[key] = maskCreditCard(value);\n      }\n      // Mask patient name fields\n      else if (lowerKey.includes('patient_name') || lowerKey.includes('name') && lowerKey.includes('patient')) {\n        sanitized[key] = maskName(value);\n      }\n      // Hash patient IDs and other sensitive identifiers\n      else if (lowerKey.includes('patient_id') || lowerKey.includes('mrn') || lowerKey.includes('medical_record')) {\n        sanitized[key] = `HASH_${hashValue(value)}`;\n      }\n      // Mask email addresses (keep domain)\n      else if (lowerKey.includes('email') && typeof value === 'string' && value.includes('@')) {\n        const [local, domain] = value.split('@');\n        sanitized[key] = `${local[0]}${'*'.repeat(Math.max(local.length - 1, 3))}@${domain}`;\n      }\n      // Mask phone numbers (keep last 4 digits)\n      else if (lowerKey.includes('phone') || lowerKey.includes('mobile')) {\n        const cleaned = String(value).replace(/\\D/g, '');\n        if (cleaned.length >= 10) {\n          sanitized[key] = `XXX-XXX-${cleaned.substring(cleaned.length - 4)}`;\n        } else {\n          sanitized[key] = 'XXX-XXX-XXXX';\n        }\n      }\n      // Recursively sanitize nested objects and arrays\n      else if (typeof value === 'object') {\n        sanitized[key] = sanitizeObject(value);\n      }\n      // Keep other values as-is\n      else {\n        sanitized[key] = value;\n      }\n    }\n    \n    return sanitized;\n  }\n  \n  return obj;\n}\n\n// Process all input items\nconst sanitizedItems = $input.all().map(item => {\n  return {\n    json: sanitizeObject(item.json),\n    pairedItem: item.pairedItem\n  };\n});\n\nreturn sanitizedItems;"
      },
      "typeVersion": 2
    },
    {
      "id": "bbb72dd6-d491-4417-827a-83575766f763",
      "name": "Staff Availability Lookup Tool",
      "type": "@n8n/n8n-nodes-langchain.toolCode",
      "position": [
        -128,
        1184
      ],
      "parameters": {
        "jsCode": "const staffId = $input.staff_id || 'all'; const mockData = { staff_id: staffId, available: true, current_workload: 3, skills: ['billing', 'scheduling'], shift_end: '17:00' }; return JSON.stringify(mockData);",
        "description": "Looks up staff availability, current workload, and skill sets for task assignment. Input: staff_id or department. Returns: availability status, current task count, skill tags, shift schedule."
      },
      "typeVersion": 1.3
    },
    {
      "id": "356db677-6534-42b9-b405-8b22db9bb371",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        0,
        1184
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b137a62a-3b81-4415-a069-e120b813bcd7",
      "name": "Merge Action Results",
      "type": "n8n-nodes-base.merge",
      "position": [
        1072,
        960
      ],
      "parameters": {
        "numberInputs": 4
      },
      "typeVersion": 3.2
    },
    {
      "id": "cefe7eee-c6d7-421b-8461-3c9f5c995da7",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        448,
        368
      ],
      "parameters": {
        "color": 5,
        "width": 480,
        "height": 336,
        "content": "## Prerequisites\nActive Anthropic API account, hospital event management system with webhook capability\n## Use Cases\nPatient admission coordination, equipment failure response, code blue orchestration\n## Customization\nModify orchestration agent prompts for facility-specific protocols\n## Benefits\nReduces event response time by 75%, ensures consistent protocol adherence"
      },
      "typeVersion": 1
    },
    {
      "id": "cc42c18e-0038-4fe0-b4e8-276fd60b4fc4",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -16,
        416
      ],
      "parameters": {
        "width": 384,
        "height": 304,
        "content": "## Setup Steps\n1. Configure webhook URL endpoint for hospital event system integration\n2. Set up Anthropic API credentials for Claude model access in orchestration agent\n3. Configure Hospital Orchestration Agent Tool with your facility's event protocols\n4. Connect Schedule Appointment API with hospital scheduling system credentials\n5. Set up Task Management API integration for staff assignment system\n6. Configure Insurance Verification API with payer network access credentials"
      },
      "typeVersion": 1
    },
    {
      "id": "d5283193-74be-410a-b8ed-cae968b2c3f4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -720,
        432
      ],
      "parameters": {
        "width": 656,
        "height": 288,
        "content": "## How It Works\nThis workflow automates hospital operational event management by intelligently processing incoming events and orchestrating appropriate responses across multiple hospital systems. Designed for hospital operations managers, healthcare IT teams, and clinical administrators, it solves the complex challenge of coordinating rapid responses to diverse hospital events including patient admissions, equipment alerts, staffing emergencies, and clinical escalations. The system receives event triggers via webhook, uses AI-powered orchestration to analyze event context and determine required actions, then intelligently routes tasks to appropriate systems including appointment scheduling, task management, and insurance verification. It calculates priority scores, assigns tasks, verifies insurance coverage, and merges results while masking sensitive PHI data for compliance. The workflow leverages Anthropic's Claude and multiple AI tools to ensure context-aware decision-making aligned with hospital protocols."
      },
      "typeVersion": 1
    },
    {
      "id": "0d162eba-4ddc-4c37-989c-8fe3f3c36363",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        768,
        784
      ],
      "parameters": {
        "color": 7,
        "width": 768,
        "height": 768,
        "content": "## Result Consolidation with PHI Protection\n**Why:** Merges outcomes from multiple system interactions, applies data masking to protected health information for HIPAA compliance, responds to originating webhook with actionable results, creating complete audit trail while safeguarding patient privacy throughout the automated workflow."
      },
      "typeVersion": 1
    },
    {
      "id": "cb93db72-f794-4c9f-8588-97043c341340",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        304,
        784
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 672,
        "content": "## Multi-System Task Routing with Priority Calculation\n**Why:** Dynamically routes orchestrated actions to appropriate hospital systems (scheduling, task management, insurance verification) based on event type, calculates priority scores using business rules and calculator tools "
      },
      "typeVersion": 1
    },
    {
      "id": "0d4474f3-fca2-4703-9e5c-83d7942b9a47",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -736,
        784
      ],
      "parameters": {
        "color": 7,
        "width": 1024,
        "height": 672,
        "content": "## Event Reception and AI-Powered Analysis\n**Why:** Captures hospital events through webhook triggers and processes them through AI orchestration agent using Claude and specialized lookup tools, ensuring intelligent interpretation of event context, urgency, and required response pathways based on hospital operational protocols."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "b0827c34-b956-4c24-ae52-fc8c4b2b5528",
  "connections": {
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "Hospital Orchestration Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Task Management API": {
      "main": [
        [
          {
            "node": "Calculate Task Priority Score",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Anthropic Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Hospital Orchestration Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Merge Action Results": {
      "main": [
        [
          {
            "node": "Mask PII and PHI Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Action Type": {
      "main": [
        [
          {
            "node": "Schedule Appointment API",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Insurance Verification API",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Task Management API",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Merge Action Results",
            "type": "main",
            "index": 3
          }
        ]
      ]
    },
    "Hospital Event Webhook": {
      "main": [
        [
          {
            "node": "Workflow Configuration",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Workflow Configuration": {
      "main": [
        [
          {
            "node": "Hospital Orchestration Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Appointment API": {
      "main": [
        [
          {
            "node": "Merge Action Results",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Hospital Orchestration Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Insurance Verification API": {
      "main": [
        [
          {
            "node": "Merge Action Results",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "Hospital Orchestration Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          },
          {
            "node": "Route by Action Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculate Task Priority Score": {
      "main": [
        [
          {
            "node": "Merge Action Results",
            "type": "main",
            "index": 2
          }
        ]
      ]
    },
    "Staff Availability Lookup Tool": {
      "ai_tool": [
        [
          {
            "node": "Hospital Orchestration Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}