Automation library · Chat assistants

Assist hospital doctors with Telegram and OpenAI

Started by an incoming Telegram message, and works across Gmail, Google Sheets, Slack and Telegram. It hands the judgement calls to OpenAI. 34 steps, 4 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

34 stepsLarge: read it before trusting it with anything live
4Branches: places the flow splits
1Loop or waits
4Services it connects to

The flow

Starts it 4Model 4Logic 9Service 17

The steps in the order they run, from what starts it.

  1. 1Schedule - Daily Follow-up CheckSchedule triggerStarts it
  2. 2Telegram Trigger - Doctor MessageTelegram triggerStarts it
  3. 3Webhook - Update Bed CountWebhookStarts it
  4. 4On Workflow ErrorError triggerStarts it
  5. 5Sheets - Get All PatientsGoogle SheetsService
  6. 6IF - Has Report DocumentIfLogic
  7. 7Sheets - Update Bed RowGoogle SheetsService
  8. 8Slack – Post Workflow Error AlertSlackService
  9. 9Filter - Due For Follow-up TodayFilterLogic
  10. 10Telegram - Download Report FileTelegramService
  11. 11IF - Is Discharge CommandIfLogic
  12. 12Loop - Over Due PatientsSplit In BatchesLogic
  13. 13Extract - Report TextExtract From FileService
  14. 14Set - Extract Patient ID (Discharge)SetLogic
  15. 15IF - Is Labs CommandIfLogic
  16. 16Telegram - Send Follow-up MessageTelegramService
  17. 17AI - Summarize ReportOpen AiModel
  18. 18Sheets - Get Patient RecordGoogle SheetsService
  19. 19Set - Extract Lab Values TextSetLogic
  20. 20IF - Is Beds CommandIfLogic
  21. 21Sheets - Mark Follow-up SentGoogle SheetsService
  22. 22Sheets - Log Report SummaryGoogle SheetsService
  23. 23AI - Generate Discharge SummaryOpen AiModel
  24. 24AI - Analyze Lab ValuesOpen AiModel
  25. 25Sheets - Read Bed AvailabilityGoogle SheetsService
  26. 26AI - Doctor Assistant ChatOpen AiModel
  27. 27Telegram - Send Report SummaryTelegramService
  28. 28Sheets - Save Discharge SummaryGoogle SheetsService
  29. 29Telegram - Send Lab AnalysisTelegramService
  30. 30Code - Format Bed AvailabilityCodeLogic
  31. 31Telegram - Send Assistant ReplyTelegramService
  32. 32Gmail - Email Discharge SummaryGmailService
  33. 33Telegram - Send Bed AvailabilityTelegramService
  34. 34Telegram - Confirm Discharge SentTelegramService

How it's built

Starts on
An incoming Telegram message
Steps
34, with 4 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Gmail, Google Sheets, Slack, Telegram
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Sheets, Slack and Telegram accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an incoming Telegram message.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 34 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 34 steps before you point it at anything that matters.