# Pharmacy Stock & Expiry Monitor

**Category:** Healthcare  
**Tools:** Google Sheets, n8n, HTTP  
**Nodes:** 32  
**Built by:** Forgent Systems

Tracks medicine stock and expiry dates, sends alerts for low, expiring and expired items, updates stock on every sale and suggests reorder quantities.

![Workflow](preview.webp)

## How it works

1. A daily check reads the full inventory.
2. Expiry status and stock levels are calculated.
3. Alerts are sent for expired, expiring and low-stock medicines.
4. Sales recorded through a form reduce stock in real time.
5. Reorder quantities are calculated and inventory status is updated.

## Use cases

- Pharmacies and chemists
- Hospital stores
- Clinic dispensaries

## Data setup

**Google Sheets** (tab: columns)

- **Pharmacy Inventory Sheet → Sheet1**: `batch_no`, `status`, `expiring_soon`, `reorder_qty`, `last_update`, `quantity`, `medicine_name`, `min_stock`, `purchase_date`, `expiry_date`, `purchase_price`, `selling_price`, `medicine_type`, `supplier_name`, `location`, `notes`

## Setup

1. In n8n open **Workflows → Import from File** and choose `workflow.json`.
2. Connect these credentials:
   - Google Sheets account
   - Twilio account
3. Point the Sheets / Airtable / Drive / Slack nodes at your own resources (structure above).
4. Replace placeholder emails, phone numbers and `YOUR-FORM-ID` links with your own.
5. Times use the America/New_York timezone and dates use MM/DD/YYYY. Adjust if needed.
6. Run a test execution, then activate.

## Nodes

- **Daily Inventory Check Trigger** — `n8n-nodes-base.scheduleTrigger`
- **Fetch Inventory Data** — `n8n-nodes-base.googleSheets`
- **Calculate Expiry Status** — `n8n-nodes-base.code`
- **Check Low Stock** — `n8n-nodes-base.if`
- **Check Expiring Soon** — `n8n-nodes-base.if`
- **Check Expired Medicines** — `n8n-nodes-base.if`
- **Send Expired Medicine Alert** — `n8n-nodes-base.twilio`
- **Send Expiry Medicine Alert** — `n8n-nodes-base.twilio`
- **Send Low Stock Medicine Alert** — `n8n-nodes-base.twilio`
- **Calculate Reorder Quantity** — `n8n-nodes-base.code`
- **Update Inventory Status** — `n8n-nodes-base.googleSheets`
- **Medicine Sale Form Trigger** — `n8n-nodes-base.formTrigger`
- **Prepare Sale Data** — `n8n-nodes-base.set`
- **Fetch Medicine Record** — `n8n-nodes-base.googleSheets`
- **Calculate Updated Stock** — `n8n-nodes-base.code`
- **Update Stock in Inventory** — `n8n-nodes-base.googleSheets`
- **Check Low Stock After Sale** — `n8n-nodes-base.if`
- **Send Low Stock Alert** — `n8n-nodes-base.twilio`
- **No Operation, do nothing** — `n8n-nodes-base.noOp`
- **Daily Reorder Check Trigger** — `n8n-nodes-base.scheduleTrigger`
- **Fetch Inventory Data1** — `n8n-nodes-base.googleSheets`
- **Prepare Inventory Data** — `n8n-nodes-base.code`
- **Check Reorder Requirement** — `n8n-nodes-base.if`
- **Calculate Reorder Quantity1** — `n8n-nodes-base.code`
- **Update Reorder Data** — `n8n-nodes-base.googleSheets`
- **Medicine Entry Form Trigger** — `n8n-nodes-base.formTrigger`
- **Save Medicine to Inventory** — `n8n-nodes-base.googleSheets`
- **Sticky Note2** — `n8n-nodes-base.stickyNote`
- **Sticky Note1** — `n8n-nodes-base.stickyNote`
- **Sticky Note** — `n8n-nodes-base.stickyNote`
- **Sticky Note3** — `n8n-nodes-base.stickyNote`
- **Sticky Note4** — `n8n-nodes-base.stickyNote`
