Track medicine adherence and monitor patients with Google Sheets, OpenAI and Slack
🩺 AI-Powered Medicine Reminder & Patient Monitoring Workflow (n8n + Google Sheets + OpenAI + Slack)
This workflow automates medicine reminders, tracks patient responses and alerts doctors in critical situations using n8n, Google Sheets, OpenAI and Slack.
Quick Implementation Steps
Connect your Google Sheets with patient data Set up Slack (or replace with Gmail/SMS nodes) Configure Webhook to receive patient replies Add your OpenAI API key Define reminder times in HH:mm format Activate the workflow scheduler
đź’ˇ You can replace Slack with Email (Gmail) or SMS APIs like Twilio.
What It Does
This workflow automates the entire lifecycle of patient medicine adherence tracking. It periodically checks patient records and sends reminders when it's time to take medicine.
When a patient responds, the system captures the reply via webhook and uses AI to classify the response into categories such as taken, not taken, delayed or unclear. It then updates patient records and tracks missed doses.
If a patient repeatedly misses medication or shows signs of distress, the system flags it as critical and alerts the doctor immediately through a separate channel.
Who’s It For
Healthcare providers and clinics Telemedicine platforms Caregivers managing patients Health-tech startups Remote monitoring systems
Requirements
n8n (cloud or self-hosted) Google Sheets account Slack account (or Email/SMS alternative) OpenAI API key Google Sheet with following columns Name Phone Medicine Reminder Time Last Response Last Patient Message Status Missed_Count
⚠️ Reminder Time must be in 24-hour format (HH:mm) Example: 08:30, 14:45, 21:00
Webhook Input Format
Your system must send patient replies in this format:
{ "phone": "string", "message": "string" }
How It Works
- Scheduler Trigger
Runs every minute Checks all patient records
- Fetch Patient Records
Reads all rows from Google Sheets
- Match Reminder Time
Compares current time with patient’s reminder time
- Send Reminder
Sends message via Slack (or Email/SMS alternative)
- Receive Patient Response
Webhook captures incoming responses
- AI Classification
Classifies response into:
TAKEN** NOT_TAKEN** LATER** CONFUSED**
Also detects critical conditions
- Parse Output
Ensures valid JSON format
- Match Patient
Matches phone number with Google Sheet
- Update Missed Count
NOT_TAKEN** → +1 LATER** → +1 TAKEN** → reset to 0
- Check Critical Condition
Triggered when:
is_critical = true OR Missed_Count >= 3 (configurable)
- Critical Flow
Update status to CRITICAL Alert doctor via separate channel
- Normal Flow
Update patient record Send response: NOT_TAKEN → Reminder LATER → Gentle follow-up TAKEN → Appreciation
Customization
Replace Slack
You can replace Slack nodes with:
Gmail (Email) Twilio (SMS) WhatsApp API
Modify AI Logic
Edit OpenAI prompt Add new classifications Customize responses
Change Reminder Logic
Adjust scheduler frequency Add timezone handling
Adjust Critical Threshold
Change Missed_Count >= 3 to any value based on your needs
Add-ons
WhatsApp integration Dashboard for tracking Push notifications Database logging AI health insights Doctor reports
Use Cases
Chronic disease monitoring Elderly care Post-surgery tracking Clinical trials Remote patient monitoring
Troubleshooting
| Issue | Possible Cause | Solution | |--------------------------|--------------------|--------------------------| | Reminder not sent | Time mismatch | Use HH:mm format | | Patient not matched | Phone mismatch | Ensure same format | | AI parsing error | Invalid JSON | Check parsing node | | Missed count issue | Wrong classification| Verify AI output | | Webhook not working | Wrong endpoint | Check URL | | Slack not sending | Credentials issue | Reconnect Slack | | Critical not triggered | Condition issue | Adjust threshold |
Need Help?
If you need help with:
Setup or deployment Email / SMS / WhatsApp integration Dashboard or analytics Custom AI enhancements
👉 Feel free to Contact WeblineIndia for custom workflow development and automation solutions.
Related Templates
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
đź“° AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
Auto-classify Gmail emails with AI and apply labels for inbox organization
Who is this for? Professionals and individuals who receive high volumes of emails, those who want to automatically organ...
đź”’ Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments