Automation + AI

Telegram-Based Inventory System

A conversational inventory management system that understands natural language, handles manager approvals, and maintains complete audit trails — all through Telegram

n8n Automation Telegram Bot OpenAI NLP Google Sheets
👷

Engineer

Sends message

→
🤖

Telegram Bot

+ n8n + OpenAI

→
📊

Google Sheets

Inventory + Logs

Project Details

My Role

Designer & Builder

Duration

4-6 weeks

Platform

Telegram (Mobile/Desktop)

Tools

n8n, Telegram API, OpenAI, Google Sheets

Status

Live in Production

What Is This?

Imagine you're an engineer on a construction site and you need to check if there are any GRE flanges in the warehouse. Instead of walking to the store and checking a spreadsheet, you just text a Telegram bot:

check gre flange 2 inch

đŸ“Ļ INVENTORY CHECK

Item: GRE FLANGE 2 Inch

Current Stock: 45 Pcs

Location: Shelf B3

Use: Take 10 | Add 5

The bot understands natural language (you don't need exact commands), handles the entire workflow from checking stock to manager approvals, and maintains a complete audit trail. It's essentially a smart inventory assistant that lives where the team already communicates.

What Makes This Different

đŸ’Ŧ

Conversational Interface

No app to download, no login to remember. Users interact through Telegram — a tool they already use daily.

🧠

AI-Powered Understanding

Type "gre flan" or "check upvc pipe" — the system understands. No need to memorize exact commands.

✅

Mobile-First Approvals

Managers approve requests with one tap on their phone — no laptop needed, even when on-site.

Who Uses It

👷

Engineers (4+)

Check inventory, request items via TAKE command, view transactions

Comfortable with phones; prefer mobile over spreadsheets on-site

📋

Store Managers (1-2)

Approve/reject requests, add new stock via ADD command

Mobile-first; often moving around, don't use Excel much

📊

Operations Manager

Oversight, transaction history review, direct Sheets access

High tech comfort; comfortable with spreadsheets and data analysis

The Problem

What Was Happening Before

A construction/engineering company's inventory tracking was a mess of manual processes that wasted time and created accountability gaps.

đŸšļ Physical Warehouse Trips

Engineers had to walk to the warehouse just to check if items were available

📉 Outdated Spreadsheets

Stock levels tracked in Excel files that were often outdated by the time someone looked at them

❓ No Audit Trail

No clear record of who took what, when, and for which project

đŸ’ģ Laptop-Dependent Managers

Managers had no visibility into real-time inventory without opening Excel on a computer

đŸ—ī¸ Project Conflicts

Material allocation for different projects tracked verbally or not at all

âš ī¸ Emergency Shortages

Low stock situations discovered only when someone physically ran out of an item

Business Impact

10-15

Hours/week wasted on manual tracking

?

Unknown materials taken without records

$$

Project delays from unexpected shortages

What Stakeholders Wanted

📊

Operations Manager

"I need visibility and audit trails for material usage"

👷

Engineers

"I want to check stock without walking to the warehouse"

📋

Store Managers

"I need to approve requests from my phone when I'm on-site"

The Solution

Technology Stack

⚡

n8n

Workflow Automation

🤖

Telegram Bot

User Interface

🧠

OpenAI

Natural Language

📊

Google Sheets

Database

Available Commands

CHECK

"gre flange 2 inch"

Search and display inventory item details

TAKE

"take 10"

Request items (triggers manager approval)

ADD

"add 50"

Restock items (triggers manager approval)

LIST_LOW

"list low stock"

Show all items below minimum stock level

SHEET

"sheet"

Get direct link to Google Sheets

SELECT

"2" (after search)

Choose from multiple matching items

Example Conversation Flow

dual conc

Found 9 matching items:

1. DUAL CONCENTRIC REDUCER 1x0.5" - Stock: 9

2. DUAL CONCENTRIC REDUCER 2x0.5" - Stock: 8

3. DUAL CONCENTRIC REDUCER 3x2" - Stock: 14

Reply with a number (1-9) to see details

3

đŸ“Ļ INVENTORY CHECK

Item: DUAL CONCENTRIC REDUCER 3x2"

Stock: 14 Pcs

Location: Shelf C2

Use: Take 5 | Add 10

take 5

âŗ REQUEST SUBMITTED

Item: DUAL CONCENTRIC REDUCER 3x2"

Quantity: 5 Pcs

Transaction ID: T134

AWAITING MANAGER APPROVAL

[Manager receives notification with APPROVE/REJECT buttons]

✅ APPROVED — T134

DUAL CONCENTRIC REDUCER 3x2"

Qty: 5 | New Stock: 9

Collect from store.

Key Design Decisions

🧠 Natural Language over Rigid Commands

Used OpenAI to parse messages so users can type "gre flange 1 inch" or "check upvc pipe" instead of memorizing exact syntax. This dramatically improved adoption since engineers don't need to remember command formats.

✅ Manager Approval for Everything

Even for ADD commands (restocking), kept the approval workflow as a "double-check" system. There was team debate — one engineer said it was unnecessary, but the Operations Manager valued the accountability. The 2-second approval click prevents costly inventory errors.

📊 Google Sheets as Database

Chose Google Sheets over a traditional database for transparency — managers can still open the spreadsheet directly when needed, and it's familiar to everyone. Also allows for easy manual corrections if needed.

đŸ’Ŧ Session-Aware Context

After viewing an item, users can just type "take 5" without repeating the item name. The system remembers what they were looking at, creating a natural conversational flow.

Clever Bits I'm Proud Of

🔍 Smart Search with Fallback

Tries exact matching first, then falls back to partial matching. "gre flan" still finds "GRE FLANGE". Handles typos and abbreviations gracefully.

🔄 Live Stock Validation

When a manager approves a request, the system re-checks current inventory before processing. If stock changed since the request was made, it rejects with a clear message instead of going negative.

📏 Decimal Quantity Support

For items measured in meters (like pipes), users can request "take 0.3" for 0.3 meters. Required special handling in the AI prompt to preserve exact decimals.

❌ Cancellation Flow

Engineers can cancel pending requests before approval. The system updates the manager's message to show it was cancelled and logs the cancellation with timestamp.

System Screenshots

Telegram Bot Check Select Take Flow

Telegram Bot — Check / Select / Take Flow

Guided conversation flow for submitting attendance actions

Manager Approval Buttons Interface

Manager Approval Interface

Inline approve / reject actions directly within Telegram

Database Structure (Google Sheets)

Sheet Name Purpose Key Columns
INVENTORY Master item list Item_ID, Material, Description, Size, Quantity, Unit, Location, Min_Stock
TRANSACTION_HISTORY Audit trail Trans_ID, Timestamp, Item_ID, Quantity_Change, Old/New_Qty, Type, Employee, Status, Approved_By
RESERVATIONS Project allocations Reservation_ID, Item_ID, For_Engineer, Project_Code, Tagged_Qty, Status
USERS Team members Telegram_Username, Display_Name, Role (engineer/manager), Chat_ID

Results & Impact

30+

Transactions Logged

10-15

Hours/Week Saved

100+

Items Tracked

~$29

Monthly Cost

Before vs After

Walk to warehouse to check stock Instant check from anywhere via Telegram
No audit trail Complete transaction history with who/what/when/approval
Manager needs laptop One-tap approval on phone while on-site
Outdated spreadsheets Real-time updates with every transaction
Verbal project allocation Tagged reservations per project/engineer

Lessons Learned

🔐 Authentication Reliability is Critical

OAuth token expiration caused recurring manual work until I switched to Google Service Account credentials. Lesson: use non-expiring auth methods for automated systems.

🔄 Always Validate Live Data

Session caching is useful, but always re-validate from the database before executing transactions. Stale data in approval workflows can cause inventory issues.

🧠 NLP Needs Careful Prompting

Natural language processing greatly improves adoption, but requires careful prompt engineering. Edge cases like "take 0.3" were being rounded until I explicitly told the AI to preserve decimals.

Future Development

🔔

Low Stock Alerts

Proactive notifications when items fall below minimum levels

â†Šī¸

RETURN Command

Allow engineers to return unused items back to inventory

đŸˇī¸

Full Reservation System

Block reserved stock from general TAKE commands

🔍

Enhanced Search

Better handling of description-only searches