Skip to content

Commit a9acaed

Browse files
Initial commit: Offline Bin Detection Automation — AI-Integrated Workflow Platform by Ansh Srivastava
0 parents  commit a9acaed

13 files changed

Lines changed: 2878 additions & 0 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Validate n8n Workflows
2+
3+
on:
4+
push:
5+
paths:
6+
- 'workflows/**'
7+
- 'scripts/**'
8+
pull_request:
9+
paths:
10+
- 'workflows/**'
11+
- 'scripts/**'
12+
13+
jobs:
14+
validate:
15+
name: Validate Offline Bin Automation Workflows
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Install dependencies
23+
run: sudo apt-get update && sudo apt-get install -y jq
24+
25+
- name: Run workflow validation script
26+
run: bash scripts/validate-workflows.sh
27+
28+
- name: Display success message
29+
if: ${{ success() }}
30+
run: echo "✅ All 8 Offline Bin Detection Automation workflows passed validation!"

.gitignore

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# ============================================================
2+
# Offline Bin Detection Automation Project - .gitignore
3+
# Developed by: [Your Full Name]
4+
# Role: AI & Automation Engineer
5+
# Organization: Renie Tech Trading LLC
6+
# ============================================================
7+
8+
# --- 🧠 System & OS Files ---
9+
.DS_Store
10+
Thumbs.db
11+
12+
# --- 🔐 Environment & Credentials ---
13+
# Local or secret configuration files (never push these)
14+
.env
15+
*.env
16+
secrets.json
17+
credentials.json
18+
*.key
19+
*.pem
20+
*.pfx
21+
22+
# --- ⚙️ n8n Related Files ---
23+
# n8n internal data, cache, or credential backups
24+
.n8n/
25+
dist/
26+
.backup/
27+
*.sqlite
28+
*.db
29+
*.tmp
30+
*.bak
31+
32+
# --- 📦 Node & Dependency Folders ---
33+
# (if n8n or any supporting script uses Node.js)
34+
node_modules/
35+
package-lock.json
36+
yarn.lock
37+
38+
# --- 🧾 Logs & Temporary Outputs ---
39+
*.log
40+
*.tmp
41+
*.swp
42+
*.cache
43+
logs/
44+
output/
45+
temp/
46+
backup/
47+
48+
# --- 🧰 Editor / IDE Configurations ---
49+
.vscode/
50+
.idea/
51+
*.code-workspace
52+
53+
# --- 🧱 Build or Export Artifacts ---
54+
__pycache__/
55+
build/
56+
export/
57+
*.zip
58+
*.tar.gz
59+
60+
# --- 🚫 Workflow Exports With Credentials ---
61+
# In case you accidentally export n8n workflows including real credentials
62+
exports_with_credentials/

README.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# 🧠 Offline Bin Detection Automation
2+
3+
### Developed at **Renie Tech Trading LLC**
4+
**Role:** AI & Automation Engineer
5+
**Engineer:** Ansh Srivastava
6+
**Year:** Jul - Aug 2025
7+
8+
---
9+
10+
11+
12+
## 🚀 Project Overview
13+
14+
**Offline Bin Detection Automation** is an intelligent, cloud-based workflow automation platform designed to **detect, classify, and service offline IoT smart bins** in real time.
15+
16+
Built entirely using **n8n** and integrated with multiple APIs, this system automates the complete operational lifecycle — from detection to alerting, escalation, and field servicing — achieving **90% manual work reduction** and **zero missed escalations**.
17+
18+
---
19+
20+
21+
22+
## 🧩 Modular Architecture
23+
24+
The automation platform is composed of **8 modular workflows**, each built as an independent yet interconnected service within n8n:
25+
26+
| # | Module | Purpose |
27+
|---|---------|----------|
28+
| **1** | Detection & Storage of Offline Bins | Detects offline bins from Renie API and logs data in Supabase |
29+
30+
| **2** | Alert Creation & POC Communication | Creates alerts and sends notifications via Twilio and SMTP |
31+
32+
| **3** | POC Response Handling | Captures and processes acknowledgment responses |
33+
34+
| **4** | POC Reminder Notifications | Sends timed reminders to unresponsive POCs |
35+
36+
| **5** | Servicing Task Creation | Auto-creates tasks in Monday.com for unresolved bins |
37+
38+
| **6** | Route Optimization & Notification | Uses Google Maps API to optimize routes and notifies via Telegram |
39+
40+
| **7** | Scheduled Power Shutdown | Handles planned outages to prevent false offline alerts |
41+
42+
| **8** | Escalation Management | Escalates unresolved cases across hierarchy levels |
43+
44+
---
45+
46+
47+
48+
## ⚙️ System Components
49+
50+
| Category | Tools & Services |
51+
|-----------|------------------|
52+
| **Automation Engine** | n8n (Node-based Workflow Automation) |
53+
| **Database** | PostgreSQL (Supabase Cloud DB) |
54+
| **Communication APIs** | Twilio API, SMTP Email |
55+
| **Task Management** | Monday.com API |
56+
| **Routing & Optimization** | Google Maps API |
57+
| **Notifications** | Telegram Bot API |
58+
| **Deployment** | Cloud Infrastructure (API-driven Integration) |
59+
60+
---
61+
62+
## 🧠 Core Capabilities
63+
64+
- Seamless integration with **Renie IoT API** for real-time data ingestion
65+
- Dynamic **Supabase (PostgreSQL)** database creation and updates
66+
- **Automated POC alerting and acknowledgment tracking**
67+
- **Monday.com task creation** and synchronization with escalation states
68+
- **Route optimization** using Google Maps API
69+
- **Live Telegram notifications** for on-field technicians
70+
- **Automated escalation workflows** for missed SLAs
71+
72+
---
73+
74+
## 🧩 Architecture Flow
75+
76+
1. **Detection:** n8n fetches bin data from Renie API.
77+
2. **Database Update:** Stores offline bin info in Supabase.
78+
3. **Alerting:** Sends SMS (Twilio) + Email (SMTP) notifications to POCs.
79+
4. **Response Tracking:** Records acknowledgments or triggers reminders.
80+
5. **Task Automation:** Creates Monday.com tickets for unresolved cases.
81+
6. **Route Optimization:** Generates optimized routes using Google Maps API.
82+
7. **Field Notification:** Sends route and task info via Telegram.
83+
8. **Escalation:** Initiates multi-level escalation based on SLA breaches.
84+
85+
---
86+
87+
## 📈 Achievements & Impact
88+
89+
| Metric | Result |
90+
|--------|--------|
91+
| Manual Escalation Work | ⬇️ Reduced by **90%** |
92+
| Missed Offline Alerts | 🚫 **Zero** after deployment |
93+
| SLA Compliance |**100% adherence** |
94+
| Response Time |**65% faster** |
95+
| Notification Reliability | 📲 **99.7% success rate** |
96+
97+
---
98+
99+
## 🧮 Validation & CI/CD
100+
101+
Automated validation ensures every workflow JSON is safe and functional:
102+
103+
104+
### Local Validation
105+
```bash
106+
bash scripts/validate-workflows.sh

docs/offline_bin_automation.md

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
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

Comments
 (0)