|
| 1 | +# 🧠 Offline Bin Detection Automation |
| 2 | + |
| 3 | +### Developed at **Renie Tech Trading LLC** |
| 4 | +**Role:** AI & Automation Engineer |
| 5 | +**Engineer:** Ansh Srivastava |
| 6 | +**Timeline:** Jul - Aug 2025 |
| 7 | +**Deployment Environment:** Cloud Infrastructure with API-driven Microservice Integration |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## 📖 Project Summary |
| 12 | + |
| 13 | +The **Offline Bin Detection Automation Project** is a cloud-based workflow automation system built to intelligently detect, classify, and service **IoT smart bins** that go offline across different city zones. |
| 14 | +This system automates the entire incident lifecycle — from real-time detection to alerting, acknowledgment tracking, service task creation, routing, and escalation — minimizing manual intervention and eliminating operational delays. |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +## 🎯 Objectives |
| 19 | + |
| 20 | +- **Detect** offline bins in real-time using IoT data streams from the Renie API |
| 21 | +- **Alert** responsible Points of Contact (POCs) automatically |
| 22 | +- **Track** responses and send timed reminders |
| 23 | +- **Assign** servicing tasks on Monday.com when required |
| 24 | +- **Optimize** field routes using Google Maps API |
| 25 | +- **Escalate** unresolved cases through multi-level hierarchy |
| 26 | +- **Notify** on-field technicians via Telegram for real-time updates |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## ⚙️ Technology Stack |
| 31 | + |
| 32 | +| Category | Tools & Services | |
| 33 | +|-----------|------------------| |
| 34 | +| Workflow Orchestration | **n8n (Node-based Automation Platform)** | |
| 35 | +| Database | **PostgreSQL (Supabase Cloud Database)** | |
| 36 | +| Communication APIs | **Twilio API**, **SMTP (Email Gateway)** | |
| 37 | +| Mapping & Routing | **Google Maps API** | |
| 38 | +| Task Management | **Monday.com API** | |
| 39 | +| Notifications | **Telegram Bot API** | |
| 40 | +| Infrastructure | Cloud-hosted (API-driven Architecture) | |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## 🧩 Modular Workflow Architecture |
| 45 | + |
| 46 | +The system is designed using **eight modular n8n workflows**, each functioning as an independent microservice but fully integrated within a central automation layer. |
| 47 | + |
| 48 | +| Module No. | Module Name | Core Function | |
| 49 | +|-------------|--------------|----------------| |
| 50 | +| **1** | Detection & Storage of Offline Bins | Automatically detects offline bins from the Renie API and stores the data in Supabase | |
| 51 | +| **2** | Alert Creation & POC Communication | Creates real-time alerts and notifies assigned POCs via Twilio (SMS) and SMTP (Email) | |
| 52 | +| **3** | POC Response Handling | Captures and processes acknowledgments or replies from POCs | |
| 53 | +| **4** | POC Reminder Notifications | Sends timed automated reminders to POCs who haven’t responded within SLA time | |
| 54 | +| **5** | Servicing Task Creation | Generates and synchronizes service tickets automatically on Monday.com | |
| 55 | +| **6** | Route Optimization & Notification | Fetches technician locations, optimizes routes using Google Maps API, and sends directions via Telegram | |
| 56 | +| **7** | Scheduled Power Shutdown | Handles predefined maintenance periods and prevents false offline alerts | |
| 57 | +| **8** | Escalation Management | Implements multi-level escalation for unresolved or delayed service incidents | |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## 🧠 Architecture & Data Flow |
| 62 | + |
| 63 | +1. **Detection Layer:** |
| 64 | + - Renie API continuously feeds IoT device status. |
| 65 | + - n8n workflow triggers automatically when a bin is detected offline. |
| 66 | + |
| 67 | +2. **Storage Layer:** |
| 68 | + - The system records offline bin details in **Supabase (PostgreSQL)** with timestamp, bin ID, location, and last online state. |
| 69 | + |
| 70 | +3. **Alert & Communication Layer:** |
| 71 | + - Alert workflows use **Twilio API** for SMS and **SMTP** for email notifications. |
| 72 | + - POCs are dynamically identified from the Supabase master table. |
| 73 | + |
| 74 | +4. **Response & Reminder Layer:** |
| 75 | + - POC responses are tracked. |
| 76 | + - If not acknowledged within SLA, reminders are sent automatically. |
| 77 | + |
| 78 | +5. **Servicing & Routing Layer:** |
| 79 | + - Monday.com API creates or updates servicing tickets. |
| 80 | + - Google Maps API calculates shortest routes and travel times. |
| 81 | + - Telegram Bot sends live notifications with servicing details and map links. |
| 82 | + |
| 83 | +6. **Escalation Layer:** |
| 84 | + - If service delay exceeds SLA, multi-level escalation triggers — |
| 85 | + escalating from on-field staff → supervisor → operations manager → escalation group. |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## 🧰 Tools & Integration Details |
| 90 | + |
| 91 | +| Function | Technology | Description | |
| 92 | +|-----------|-------------|--------------| |
| 93 | +| **IoT Data Source** | Renie API | Provides bin telemetry and online/offline status | |
| 94 | +| **Database** | Supabase (PostgreSQL) | Stores all bin metadata, offline logs, SLA metrics | |
| 95 | +| **Communication** | Twilio / SMTP | Sends SMS and email alerts to POCs | |
| 96 | +| **Task Management** | Monday.com API | Auto-creates service tickets and updates statuses | |
| 97 | +| **Routing** | Google Maps API | Calculates optimized servicing routes | |
| 98 | +| **Notifications** | Telegram Bot | Delivers real-time servicing updates to technicians | |
| 99 | +| **Automation Engine** | n8n | Orchestrates all workflows and integrations | |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +## 🚀 Key Achievements |
| 104 | + |
| 105 | +- **90% reduction** in manual escalation work |
| 106 | +- **Zero missed offline incidents** after automation deployment |
| 107 | +- **Fully SLA-compliant** response and servicing cycle |
| 108 | +- **Dynamic real-time route optimization** using Google Maps API |
| 109 | +- **Live technician communication** via Telegram notifications |
| 110 | +- **Cloud-native modular design**, ready for horizontal scaling |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +## 🧩 Workflow Deployment Overview |
| 115 | + |
| 116 | +| Component | Description | |
| 117 | +|------------|-------------| |
| 118 | +| **n8n Server** | Hosted on cloud infrastructure; workflows deployed through import JSON mechanism | |
| 119 | +| **Database (Supabase)** | Managed PostgreSQL instance storing all workflow data | |
| 120 | +| **APIs** | All integrations (Twilio, Monday.com, Telegram, Google Maps) authenticated through environment credentials | |
| 121 | +| **Credentials Management** | Handled within n8n credential nodes (never exposed in GitHub) | |
| 122 | +| **CI/CD Validation** | GitHub Actions auto-validate JSON integrity on every push | |
| 123 | + |
| 124 | +--- |
| 125 | + |
| 126 | +## 📈 Project Impact |
| 127 | + |
| 128 | +| Area | Before Automation | After Automation | |
| 129 | +|-------|-------------------|------------------| |
| 130 | +| Offline Bin Detection | Manual log monitoring | Fully automated 24/7 detection | |
| 131 | +| Alert Creation | Email chains | Automated SMS & Email alerts | |
| 132 | +| POC Response Tracking | Manual follow-up | Auto-tracked with timed reminders | |
| 133 | +| Task Assignment | Human entry in Monday.com | Auto-created service tickets | |
| 134 | +| Route Planning | Manual Google Maps lookup | Automated route optimization | |
| 135 | +| Escalations | Often delayed | Instant multi-level escalations | |
| 136 | +| Reporting | Periodic spreadsheets | Real-time dashboard sync via Supabase | |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## 🧮 Performance Metrics |
| 141 | + |
| 142 | +- **Mean Response Time Reduction:** 65% |
| 143 | +- **Escalation Compliance:** 100% |
| 144 | +- **Manual Effort Reduction:** 90% |
| 145 | +- **Notification Success Rate:** 99.7% (Twilio + Telegram combined) |
| 146 | +- **Uptime:** > 99% since final deployment |
| 147 | + |
| 148 | +--- |
| 149 | + |
| 150 | +## 🧱 Repository Structure |
| 151 | + |
0 commit comments