AutomationFlowsSlack & Telegram › Assist Hospital Doctors via Telegram with Openai, Google Sheets, Gmail and Slack

Assist Hospital Doctors via Telegram with Openai, Google Sheets, Gmail and Slack

ByRahul Joshi @rahul08 on n8n.io

This workflow combines a Telegram doctor bot, OpenAI, Google Sheets, Gmail, Slack, and a webhook to summarize PDF reports, generate and email discharge summaries, analyze lab values, report bed availability, send daily patient follow-ups, and post error alerts. Runs every day at…

Cron / scheduled trigger★★★★★ complexityAI-powered44 nodesGoogle SheetsTelegramTelegram TriggerOpenAIGmailError TriggerSlack
Slack & Telegram Trigger: Cron / scheduled Nodes: 44 Complexity: ★★★★★ AI nodes: yes Added:

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

This workflow follows the Error Trigger → 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": "TUsQbt8iw4PhYTTs",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "AI Hospital Operations & Doctor Assistant System",
  "tags": [],
  "nodes": [
    {
      "id": "1920acc7-dfea-47ed-a7fe-9395b266fc25",
      "name": "\ud83d\udccc Overview \u2013 How This Workflow Works",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1168,
        2704
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "0eb2eae8-1a28-41d2-b91a-334fbb52b923",
      "name": "Section \u2013 Daily Patient Follow-up",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2304,
        2704
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "623fa5d1-8a7a-457d-a22c-5427787750f2",
      "name": "Section \u2013 Doctor Bot & Command Router",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2256,
        3408
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "b7a33f9c-9a28-484e-920d-de53eea8d547",
      "name": "Section \u2013 Report PDF Summary",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3392,
        3408
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "6414523b-ecd2-4105-b5c7-52aeec3e1b95",
      "name": "Section \u2013 Discharge Pipeline",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2832,
        3936
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "aff36f95-0af7-43db-9619-a8ea3d21beae",
      "name": "Section \u2013 Lab Value Analysis",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3248,
        4448
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "ba2860a9-5327-4990-adad-50dd8db938e0",
      "name": "Section \u2013 Bed Management",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3360,
        4816
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "cbab5645-7e30-4d67-8b88-a11d4a43d554",
      "name": "Section \u2013 General AI Assistant",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4080,
        5312
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "812f022e-61f7-41ac-aedb-206507767215",
      "name": "Section \u2013 Error Handling",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2112,
        4560
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "9a6e1874-c5b6-42ed-a004-1b6d63cce396",
      "name": "\ud83d\udd11 Credentials & Security",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        4928,
        5328
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "8c38a5dc-b302-4caa-86c8-54ad572616c8",
      "name": "Schedule - Daily Follow-up Check",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        2352,
        2976
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "bba59374-afd9-498f-94eb-10cf95be7fca",
      "name": "Sheets - Get All Patients",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2624,
        2976
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "814c3c25-89a1-4f9c-b34d-f696df331ab1",
      "name": "Filter - Due For Follow-up Today",
      "type": "n8n-nodes-base.filter",
      "position": [
        2896,
        2976
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "ac4f570e-fdc4-4521-9be3-e2c0f534536f",
      "name": "Loop - Over Due Patients",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        3152,
        2976
      ],
      "parameters": {},
      "typeVersion": 3
    },
    {
      "id": "b721c1b2-bccc-4d4f-b8dd-206e389aeda9",
      "name": "Telegram - Send Follow-up Message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3408,
        3024
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "334cbcf3-eca5-4859-a19a-979f2a31eeda",
      "name": "Sheets - Mark Follow-up Sent",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3776,
        3024
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "46e5d3ff-5743-421e-ab56-8c05318b54ff",
      "name": "Telegram Trigger - Doctor Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        2336,
        3616
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "7488a72b-6f61-46a3-bb5c-0abf669e1597",
      "name": "IF - Has Report Document",
      "type": "n8n-nodes-base.if",
      "position": [
        2608,
        3616
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "db05a6a2-ed50-48e1-ab1a-fc3d0ef2bff1",
      "name": "IF - Is Discharge Command",
      "type": "n8n-nodes-base.if",
      "position": [
        2896,
        4128
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "807a203f-d44d-42ad-a87a-22e3d0858660",
      "name": "IF - Is Labs Command",
      "type": "n8n-nodes-base.if",
      "position": [
        3344,
        4608
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "f54c291b-9409-4705-aa2c-de2e869f75c1",
      "name": "IF - Is Beds Command",
      "type": "n8n-nodes-base.if",
      "position": [
        3584,
        4992
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "e43be1e8-e143-4990-a0b2-1ab89ddd888c",
      "name": "Telegram - Download Report File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        3072,
        3600
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "a8e2e74a-4a99-487e-a835-1b70af6a2c4b",
      "name": "Extract - Report Text",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        3472,
        3632
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "352a5552-1a7a-49b4-9d6c-fae4c434d950",
      "name": "AI - Summarize Report",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3712,
        3632
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "1e576a62-01c4-48a5-996c-c62e1b9df5b8",
      "name": "Sheets - Log Report Summary",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4144,
        3632
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "32626e8a-5771-4544-be96-02fa8a5f304e",
      "name": "Telegram - Send Report Summary",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4384,
        3632
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "947e89d0-dbca-4f62-9b1c-b038a40afcd6",
      "name": "Set - Extract Patient ID (Discharge)",
      "type": "n8n-nodes-base.set",
      "position": [
        3232,
        4112
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "c882893c-0de3-4a38-8cc4-26d820d84d0e",
      "name": "Sheets - Get Patient Record",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3472,
        4112
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "ead18d04-07f0-4ddc-b181-30b3ef9eb14c",
      "name": "AI - Generate Discharge Summary",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        3712,
        4112
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "4b790274-5602-4722-aabd-48036ff0f405",
      "name": "Sheets - Save Discharge Summary",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4064,
        4112
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "9a84b7ea-78a4-4988-96a9-80748ec825e6",
      "name": "Gmail - Email Discharge Summary",
      "type": "n8n-nodes-base.gmail",
      "position": [
        4304,
        4112
      ],
      "parameters": {},
      "typeVersion": 2.1
    },
    {
      "id": "1bb7b474-b38f-4fc9-9aa1-d0edbfcc7338",
      "name": "Telegram - Confirm Discharge Sent",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4544,
        4112
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "ee497311-d4d2-479f-afd1-55982e1be21d",
      "name": "Set - Extract Lab Values Text",
      "type": "n8n-nodes-base.set",
      "position": [
        3824,
        4592
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "7ffb31d6-e814-4452-9ed1-fe2e8ce41c19",
      "name": "AI - Analyze Lab Values",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        4064,
        4592
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "27053685-37e8-4443-a1b6-0b2841f9d2e7",
      "name": "Telegram - Send Lab Analysis",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4400,
        4592
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "0ca58009-8fd5-4c5b-b1ea-5b6f0d590ad9",
      "name": "Sheets - Read Bed Availability",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        3872,
        4976
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "31d6b79a-c04c-4535-8e19-45183d4fdee9",
      "name": "Code - Format Bed Availability",
      "type": "n8n-nodes-base.code",
      "position": [
        4112,
        4976
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "0d26b611-8bb3-4b42-927a-7b63baed5359",
      "name": "Telegram - Send Bed Availability",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4352,
        4976
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "d1e0e53e-aacf-4d52-8bf2-74f0bde6a3b1",
      "name": "AI - Doctor Assistant Chat",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        4128,
        5520
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "6b76ee39-5143-4538-8534-163d6d77f4dd",
      "name": "Telegram - Send Assistant Reply",
      "type": "n8n-nodes-base.telegram",
      "position": [
        4592,
        5520
      ],
      "parameters": {},
      "typeVersion": 1.2
    },
    {
      "id": "f846e32e-e739-4596-ac60-4f85c6b054e3",
      "name": "Webhook - Update Bed Count",
      "type": "n8n-nodes-base.webhook",
      "position": [
        4624,
        4992
      ],
      "parameters": {},
      "typeVersion": 2
    },
    {
      "id": "7fb2b0e3-8c65-471f-8441-f87670e0aec3",
      "name": "Sheets - Update Bed Row",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        4896,
        4992
      ],
      "parameters": {},
      "typeVersion": 4.5
    },
    {
      "id": "dfbbf92b-a50d-47bb-a6dd-a7eaa63758bf",
      "name": "On Workflow Error",
      "type": "n8n-nodes-base.errorTrigger",
      "position": [
        2208,
        4768
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "2a8a50de-cc06-4b69-a6ed-f8c092ea2e97",
      "name": "Slack \u2013 Post Workflow Error Alert",
      "type": "n8n-nodes-base.slack",
      "position": [
        2464,
        4768
      ],
      "parameters": {},
      "typeVersion": 2.3
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "be68a777-7451-42c6-9a8d-9fa90736629f",
  "nodeGroups": [],
  "connections": {
    "On Workflow Error": {
      "main": [
        [
          {
            "node": "Slack \u2013 Post Workflow Error Alert",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF - Is Beds Command": {
      "main": [
        [
          {
            "node": "Sheets - Read Bed Availability",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI - Doctor Assistant Chat",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF - Is Labs Command": {
      "main": [
        [
          {
            "node": "Set - Extract Lab Values Text",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "IF - Is Beds Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI - Summarize Report": {
      "main": [
        [
          {
            "node": "Sheets - Log Report Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract - Report Text": {
      "main": [
        [
          {
            "node": "AI - Summarize Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI - Analyze Lab Values": {
      "main": [
        [
          {
            "node": "Telegram - Send Lab Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF - Has Report Document": {
      "main": [
        [
          {
            "node": "Telegram - Download Report File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "IF - Is Discharge Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop - Over Due Patients": {
      "main": [
        [],
        [
          {
            "node": "Telegram - Send Follow-up Message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF - Is Discharge Command": {
      "main": [
        [
          {
            "node": "Set - Extract Patient ID (Discharge)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "IF - Is Labs Command",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sheets - Get All Patients": {
      "main": [
        [
          {
            "node": "Filter - Due For Follow-up Today",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI - Doctor Assistant Chat": {
      "main": [
        [
          {
            "node": "Telegram - Send Assistant Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook - Update Bed Count": {
      "main": [
        [
          {
            "node": "Sheets - Update Bed Row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sheets - Get Patient Record": {
      "main": [
        [
          {
            "node": "AI - Generate Discharge Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sheets - Log Report Summary": {
      "main": [
        [
          {
            "node": "Telegram - Send Report Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sheets - Mark Follow-up Sent": {
      "main": [
        [
          {
            "node": "Loop - Over Due Patients",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set - Extract Lab Values Text": {
      "main": [
        [
          {
            "node": "AI - Analyze Lab Values",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code - Format Bed Availability": {
      "main": [
        [
          {
            "node": "Telegram - Send Bed Availability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sheets - Read Bed Availability": {
      "main": [
        [
          {
            "node": "Code - Format Bed Availability",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI - Generate Discharge Summary": {
      "main": [
        [
          {
            "node": "Sheets - Save Discharge Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail - Email Discharge Summary": {
      "main": [
        [
          {
            "node": "Telegram - Confirm Discharge Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sheets - Save Discharge Summary": {
      "main": [
        [
          {
            "node": "Gmail - Email Discharge Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram - Download Report File": {
      "main": [
        [
          {
            "node": "Extract - Report Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter - Due For Follow-up Today": {
      "main": [
        [
          {
            "node": "Loop - Over Due Patients",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule - Daily Follow-up Check": {
      "main": [
        [
          {
            "node": "Sheets - Get All Patients",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram - Send Follow-up Message": {
      "main": [
        [
          {
            "node": "Sheets - Mark Follow-up Sent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger - Doctor Message": {
      "main": [
        [
          {
            "node": "IF - Has Report Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set - Extract Patient ID (Discharge)": {
      "main": [
        [
          {
            "node": "Sheets - Get Patient Record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

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

About this workflow

This workflow combines a Telegram doctor bot, OpenAI, Google Sheets, Gmail, Slack, and a webhook to summarize PDF reports, generate and email discharge summaries, analyze lab values, report bed availability, send daily patient follow-ups, and post error alerts. Runs every day at…

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

More Slack & Telegram workflows → · Browse all categories →

Related workflows

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

Slack & Telegram

This comprehensive N8N automation template revolutionizes content creation by delivering a complete end-to-end solution for AI-powered blog generation. Transform simple ideas into fully SEO-optimized,

Slack Trigger, Telegram Trigger, Gmail Trigger +16
Slack & Telegram

This workflow captures rental applications from Telegram, uses OpenAI to extract applicant details and score risk after a credit/background API check, logs everything in Google Sheets, notifies the la

Slack, Error Trigger, Telegram +5
Slack & Telegram

This advanced n8n workflow is designed for SEO specialists, digital agency owners, webmasters, and marketing managers who need a comprehensive, automated solution to track and improve their website's

Google Sheets Tool, Telegram Trigger, Telegram +9
Slack & Telegram

This n8n workflow is designed for SEO managers, content creators, and blog administrators who want to automate their blog publishing pipeline. The workflow creates an end-to-end AI-powered system that

Output Parser Autofixing, OpenAI Chat, Webflow Tool +11
Slack & Telegram

This template is perfect for: AI art enthusiasts who want to stay updated on trending AI-generated artwork Content curators looking to automate art discovery Japanese-speaking users who want translate

@Apify/N8N Nodes Apify, Google Sheets, OpenAI Chat +6