AutomationFlowsAI & RAG › Automate Patient Intake and AI Risk Triage with Azure Openai, Google, and Slack

Automate Patient Intake and AI Risk Triage with Azure Openai, Google, and Slack

ByRahul Joshi @rahul08 on n8n.io

Automate patient pre-arrival intake, AI risk assessment, and real-time doctor alerts in one seamless healthcare workflow. ⏰📧 This automation sends scheduled intake reminders before appointments, analyzes submitted patient data using AI, and flags high-risk cases instantly via…

Cron / scheduled trigger★★★★☆ complexityAI-powered16 nodesGoogle CalendarGmailGoogle Sheets TriggerAgentGoogle SheetsSlackLm Chat Azure Open Ai
AI & RAG Trigger: Cron / scheduled Nodes: 16 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow corresponds to n8n.io template #13520 — we link there as the canonical source.

This workflow follows the Agent → Gmail recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "Z7pT3C4RAhLxE6LV",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Patient Pre-Arrival Intake Automation",
  "tags": [],
  "nodes": [
    {
      "id": "224e8bd7-da15-41e6-bff2-9f2cd35ad0e2",
      "name": "\ud83d\udccb Overview",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1232,
        960
      ],
      "parameters": {
        "color": 3,
        "width": 560,
        "height": 764,
        "content": "## \ud83c\udfe5 Patient Pre-Arrival Intake Automation\n\n### How it works\nThis workflow automates two parallel healthcare processes:\n\n**Branch 1 \u2014 Appointment Reminders:** Every hour, the workflow fetches upcoming appointments from Google Calendar and sends a pre-arrival intake email to each patient via Gmail, prompting them to complete their intake form before the visit.\n\n**Branch 2 \u2014 AI Risk Assessment:** When a patient submits the intake form (detected via Google Sheets Trigger), an Azure OpenAI-powered AI agent analyses the patient's symptoms, allergies, and medical history. It assigns a risk level (Low / Medium / High / Emergency), flags allergy risks, notes medication conflicts, and generates doctor preparation notes. The output is parsed, normalised, and written back to Google Sheets. If the risk level is **High** or above, a real-time Slack alert is sent to the doctor.\n\n### Setup steps\n1. Connect **Google Calendar** OAuth2 credentials to the Hourly Trigger branch.\n2. Connect **Gmail** OAuth2 credentials for the intake email node.\n3. Connect **Google Sheets Trigger** OAuth2 and point it to your intake form responses sheet.\n4. Connect **Azure OpenAI** credentials (deployment: `gpt-4o-mini`) to the AI agent.\n5. Connect **Google Sheets** OAuth2 for writing assessment results to `Sheet1`.\n6. Connect **Slack** OAuth2 and replace `YOUR_SLACK_CHANNEL` with your actual channel ID.\n\n### Customization\n- Adjust the cron interval on the Hourly Trigger to match your clinic's schedule.\n- Modify the AI system prompt to add speciality-specific risk criteria.\n- Expand the Slack alert to include emergency/medium risk levels via the IF node."
      },
      "typeVersion": 1
    },
    {
      "id": "0b3adea4-5c18-4f14-abc6-a06c53f44d40",
      "name": "Section: Appointment Reminder",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -528,
        752
      ],
      "parameters": {
        "width": 640,
        "height": 200,
        "content": "## \ud83d\udcc5 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 history before their visit."
      },
      "typeVersion": 1
    },
    {
      "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": "## \ud83e\udd16 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, confidence score, and doctor preparation notes. Output is parsed and normalised before being stored."
      },
      "typeVersion": 1
    },
    {
      "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": "## \ud83d\udcca Risk Triage & Doctor Notification\nStores the AI assessment back into Google Sheets (Sheet1). Checks if risk level is **High** \u2014 if so, fires an instant Slack alert to the assigned doctor with patient name, key concerns, allergy flags, and preparation notes."
      },
      "typeVersion": 1
    },
    {
      "id": "72b9461a-1344-4776-be3f-591f0fa34fc0",
      "name": "\u26a0\ufe0f Warning: Slack Config",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        1120
      ],
      "parameters": {
        "color": 2,
        "width": 260,
        "height": 150,
        "content": "\u26a0\ufe0f **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."
      },
      "typeVersion": 1
    },
    {
      "id": "499ecd67-0dec-435e-b8ed-9597c9f505a6",
      "name": "\u26a0\ufe0f Warning: Azure OpenAI",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        1600
      ],
      "parameters": {
        "color": 2,
        "width": 260,
        "height": 150,
        "content": "\u26a0\ufe0f **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."
      },
      "typeVersion": 1
    },
    {
      "id": "6842f180-285d-479e-984b-55cf24da4504",
      "name": "Hourly Schedule Trigger",
      "type": "n8n-nodes-base.cron",
      "position": [
        -464,
        976
      ],
      "parameters": {
        "triggerTimes": {
          "item": [
            {
              "mode": "everyHour"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "08efb4fc-5703-46db-b1ac-74867e649721",
      "name": "Fetch Calendar Appointments",
      "type": "n8n-nodes-base.googleCalendar",
      "position": [
        -272,
        976
      ],
      "parameters": {
        "options": {},
        "calendar": {
          "__rl": true,
          "mode": "list",
          "value": "primary"
        },
        "operation": "getAll",
        "returnAll": true
      },
      "credentials": {
        "googleCalendarOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "0d89988a-05ce-40b6-bc0b-06a3cd6a7710",
      "name": "Send Pre-Arrival Intake Email",
      "type": "n8n-nodes-base.gmail",
      "position": [
        -64,
        976
      ],
      "parameters": {
        "toList": [
          "user@example.com"
        ],
        "message": "cdcd",
        "subject": "hii",
        "resource": "message",
        "additionalFields": {}
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "277a99af-7589-4e66-bf3b-85eec473dfb7",
      "name": "Watch Intake Form Responses",
      "type": "n8n-nodes-base.googleSheetsTrigger",
      "position": [
        -480,
        1408
      ],
      "parameters": {
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 997547145,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QeHhYXc-F0SPZzLpWa7fIlG5sWjPS2h2sLGcEeFb7AI/edit#gid=997547145",
          "cachedResultName": "Form Responses 1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1QeHhYXc-F0SPZzLpWa7fIlG5sWjPS2h2sLGcEeFb7AI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QeHhYXc-F0SPZzLpWa7fIlG5sWjPS2h2sLGcEeFb7AI/edit?usp=drivesdk",
          "cachedResultName": "Patient pre-arrival intake form (Responses)"
        }
      },
      "credentials": {
        "googleSheetsTriggerOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "9714372f-79a8-4b4f-b1f0-63bd4411e1ca",
      "name": "AI Risk Assessment Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -224,
        1408
      ],
      "parameters": {
        "text": "=Here is the patient intake information:\n\nFull Name: {{ $json[\"Name\"] }}\nAge or DOB: {{ $json['  Date of Birth  '] }}\nReason for Visit: {{ $json['  Reason for Visit  '] }}\n\nSymptoms:\n{{ $json['  Please describe your current symptoms  '] }}\n\nKnown Allergies:\n{{ $json['  Do you have any known allergies?  if yes, please describe'] }}\n\n\nPlease assess the medical risk level based on this information and return structured JSON as instructed.",
        "options": {
          "systemMessage": "=You are a clinical intake risk assessment assistant.\n\nYour task is to analyze patient intake form responses before a medical appointment.\n\nYou must:\n1. Identify potential medical risk factors.\n2. Assess urgency level (Low, Medium, High, Emergency).\n3. Detect allergy risks.\n4. Flag possible medication conflicts if mentioned.\n5. Extract key medical concerns in structured format.\n6. Be cautious and safety-oriented.\n7. Never provide diagnosis.\n8. Never provide treatment recommendations.\n9. Only assess risk level and summarize concerns.\n\nIMPORTANT:\n- If symptoms include chest pain, breathing difficulty, unconsciousness, or signs of anaphylaxis, classify as \"Emergency\".\n- If severe pain (8\u201310), worsening symptoms, or chronic disease complications appear, classify at least \"High\".\n- If mild symptoms without risk indicators, classify as \"Low\".\n\nYou must return your output in strict JSON format.\n\nRequired JSON structure:\n\n{\n  \"risk_level\": \"Low | Medium | High | Emergency\",\n  \"requires_immediate_attention\": true | false,\n  \"allergy_flag\": true | false,\n  \"medication_conflict_risk\": true | false,\n  \"key_concerns\": [\"bullet point summary\"],\n  \"doctor_preparation_notes\": \"short paragraph summary for physician\",\n  \"confidence_score\": 0-100\n}\n\nDo not include explanations outside JSON.\nReturn valid JSON only."
        },
        "promptType": "define"
      },
      "typeVersion": 3
    },
    {
      "id": "0a997b53-5985-4e77-8b19-d576d59a2cd0",
      "name": "Normalize AI Output",
      "type": "n8n-nodes-base.code",
      "position": [
        128,
        1408
      ],
      "parameters": {
        "jsCode": "// Get raw output string\nconst rawOutput = $json.output;\n\n// Safety check\nif (!rawOutput) {\n  throw new Error(\"No AI output found.\");\n}\n\nlet parsed;\n\n// Try parsing JSON safely\ntry {\n  parsed = JSON.parse(rawOutput);\n} catch (error) {\n  throw new Error(\"AI output is not valid JSON.\");\n}\n\n// Normalize risk level formatting\nconst normalizedRisk = parsed.risk_level?.trim() || \"Unknown\";\n\n// Ensure boolean values\nconst requiresImmediateAttention = Boolean(parsed.requires_immediate_attention);\nconst allergyFlag = Boolean(parsed.allergy_flag);\nconst medicationConflictRisk = Boolean(parsed.medication_conflict_risk);\n\n// Normalize confidence score\nlet confidence = Number(parsed.confidence_score);\nif (isNaN(confidence)) {\n  confidence = 0;\n}\n\n// Return clean structured JSON\nreturn [\n  {\n    json: {\n      risk_level: normalizedRisk,\n      requires_immediate_attention: requiresImmediateAttention,\n      allergy_flag: allergyFlag,\n      medication_conflict_risk: medicationConflictRisk,\n      key_concerns: parsed.key_concerns || [],\n      doctor_preparation_notes: parsed.doctor_preparation_notes || \"\",\n      confidence_score: confidence\n    }\n  }\n];"
      },
      "typeVersion": 2
    },
    {
      "id": "086887e7-d121-4df3-9fe1-f3a658eb302d",
      "name": "Save Assessment to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        448,
        1408
      ],
      "parameters": {
        "columns": {
          "value": {
            "Name": "={{ $('Watch Intake Form Responses').item.json.Name }}",
            "Risk level": "={{ $json.risk_level }}",
            "allergy flag": "={{ $json.allergy_flag }}",
            "key concerns": "={{ $json.key_concerns }}",
            "confidence score": "={{ $json.confidence_score }}",
            "immidiate action": "={{ $json.requires_immediate_attention }}",
            "Doctor prepartion notes": "={{ $json.doctor_preparation_notes }}"
          },
          "schema": [
            {
              "id": "Name",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Name",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Risk level",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Risk level",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "immidiate action",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "immidiate action",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "allergy flag",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "allergy flag",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "key concerns",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "key concerns",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Doctor prepartion notes",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Doctor prepartion notes",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "confidence score",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "confidence score",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "Name"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "appendOrUpdate",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": 269975083,
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QeHhYXc-F0SPZzLpWa7fIlG5sWjPS2h2sLGcEeFb7AI/edit#gid=269975083",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1QeHhYXc-F0SPZzLpWa7fIlG5sWjPS2h2sLGcEeFb7AI",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1QeHhYXc-F0SPZzLpWa7fIlG5sWjPS2h2sLGcEeFb7AI/edit?usp=drivesdk",
          "cachedResultName": "Patient pre-arrival intake form (Responses)"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.7
    },
    {
      "id": "d5c63f4f-864a-4a00-88a8-b4b8813035d9",
      "name": "Check Risk Level",
      "type": "n8n-nodes-base.if",
      "position": [
        768,
        1408
      ],
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json[\"Risk level\"] }}",
              "value2": "High"
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "ffbd555a-5222-4104-b291-e3dbd0afb371",
      "name": "Notify Doctor via Slack",
      "type": "n8n-nodes-base.slack",
      "position": [
        1232,
        1328
      ],
      "parameters": {
        "text": "=\ud83d\udea8 High-Risk Patient Alert\n\nPatient: {{$json[\"Name\"]}}\nSymptoms: {{ $json[\"key concerns\"] }}\nAllergies: {{ $json[\"allergy flag\"] }}\n\n\u26a0 Doctor notes:\n{{ $json[\"Doctor prepartion notes\"] }}\n\nPlease review before appointment.",
        "channel": "YOUR_SLACK_CHANNEL",
        "attachments": [],
        "otherOptions": {},
        "authentication": "oAuth2"
      },
      "credentials": {
        "slackOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4bdc07e3-b2ea-4e74-831e-98cc4020abb8",
      "name": "Azure OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "position": [
        -416,
        1616
      ],
      "parameters": {
        "model": "gpt-4o-mini",
        "options": {}
      },
      "credentials": {
        "azureOpenAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "8ebb765b-ce2b-4ef2-aeb1-b1c250836b5a",
  "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
          }
        ]
      ]
    }
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Automate patient pre-arrival intake, AI risk assessment, and real-time doctor alerts in one seamless healthcare workflow. ⏰📧 This automation sends scheduled intake reminders before appointments, analyzes submitted patient data using AI, and flags high-risk cases instantly via…

Source: https://n8n.io/workflows/13520/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

This workflow automates end-to-end pre-surgery checklist reminders and confirmation tracking for healthcare operations teams. It ensures patients receive timely preparation instructions, can confirm c

Google Calendar, Agent, Lm Chat Azure Open Ai +4
AI & RAG

Automate Jira backlog management with intelligent cleanup, prioritization, and AI-powered reporting. This workflow scans daily to identify stale issues, missing priorities, and overdue tasks — auto-up

Jira, Google Sheets, Slack +4
AI & RAG

Author: Hyrum Hurst, AI Automation Engineer at QuarterSmart Contact: hyrum@quartersmart.com

HTTP Request, Google Sheets, Agent +4
AI & RAG

Created by: Peyton Leveillee Last updated: October 2025

OpenAI Chat, Google Sheets, HTTP Request +5
AI & RAG

This workflow automates the creation, rendering, approval, and posting of TikTok-style POV (Point of View) videos to Instagram, with cross-posting to Facebook and YouTube. It eliminates manual video p

OpenAI Chat, Output Parser Item List, HTTP Request +10