Skip to content

This project automates prescription refill reminders using n8n. It sends daily reminders to patients via Email, WhatsApp, and Telegram—and tracks responses in a MySQL database.

Notifications You must be signed in to change notification settings

akash247777/Prescription_reminder-N8N

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Prescription_reminder-N8N

💊 Prescription Refill Reminder System (n8n Workflow)

This project automates prescription refill reminders using n8n. It sends daily reminders to patients via Email, WhatsApp, and Telegram—and tracks responses in a MySQL database.


Demo 🎞📽🎥

Demo.mp4

🔧 Features

✅ Automatically runs every day at 9:00 AM
✅ Checks which prescriptions are due for refill
✅ Sends:

  • ✉️ Email Reminder
  • 💬 WhatsApp Message
  • 📢 Telegram Notification
    ✅ Updates the database to avoid duplicate reminders
    ✅ Fully open-source & self-hosted

🏥 How This Helped Pharmacies

Pharmacies handles millions of prescriptions monthly. Previously, many patients would forget to refill their medicines on time, risking treatment lapses.

By deploying this system:

  • ⏱️ Reduced manual follow-ups by 85%
  • 📈 Increased patient adherence & retention
  • 💬 Boosted engagement through multichannel messaging
  • 💸 Saved operational costs by automating reminders

🧠 This project became a crucial part of patient engagement automation pipeline.


🖼️ Workflow Overview

[ Cron Trigger ] → [ Fetch Due Prescriptions (MySQL) ]

[ Set Fields (Patient ID, Email, Name, Telegram, WhatsApp) ]

↓ ↓ ↓ ↓

[ Email ] [ WhatsApp ] [ Telegram ] [ Update reminder_sent in MySQL ]


image

🧱 Requirements

  • n8n self-hosted (Docker recommended)
  • MySQL database with a prescriptions table
  • SMTP Email account
  • Twilio WhatsApp API credentials (or Gupshup)
  • Telegram Bot Token + Chat IDs

🗃️ Database Schema (MySQL)

CREATE TABLE prescriptions (
  id INT AUTO_INCREMENT PRIMARY KEY,
  patient_name VARCHAR(100),
  email VARCHAR(100),
  Whatsappnumber VARCHAR(20),
  telegram_chat_id VARCHAR(20),
  medicine_name VARCHAR(100),
  dosage VARCHAR(100),
  purchase_date DATE,
  refill_interval INT,
  reminder_sent BOOLEAN DEFAULT 0
);

🚀 Setup Instructions

  1. Clone this repo
  2. Import the provided prescription_reminder.json into n8n
  3. Add your credentials in n8n:
  • MySQL
  • SMTP
  • Twilio (or WhatsApp provider)
  • Telegram Bot
  1. Ensure cron is active (runs daily at 9:00 AM)
  2. Test manually using n8n’s UI

📬 Message Templates

Email

Hello {{$json["patient_name"]}},<br><br>
This is a reminder to refill your prescription:<br>
<b>Medicine:</b> {{$json["medicine_name"]}}<br>
<b>Dosage:</b> {{$json["dosage"]}}<br><br>
Please visit your nearest Apollo Pharmacy</a> or order online.<br><br>
<a href="https://www.example.com/">Order Online at </a> 
<br>Stay healthy!<br>
Pharmacy

WhatsApp / Telegram

🩺 Hello {{$json["patient_name"]}},
This is a reminder to refill your prescription:

💊 {{$json["medicine_name"]}}
💡 Dosage: {{$json["dosage"]}}

Visit Pharmacy or order online.
Stay healthy!

🔗 https://www.example.com/

About

This project automates prescription refill reminders using n8n. It sends daily reminders to patients via Email, WhatsApp, and Telegram—and tracks responses in a MySQL database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published