Track your Shipments with a Telegram Bot
Learn how a Telegram Bot designed with Python or n8n, used by truck drivers, can help companies track their shipments.
Most of the small and medium-sized companies do not have reliable systems to monitor their logistics operations.
They may rely on manual tracking systems, such as Excel or even paper-based systems.
How can we design light solutions to automate transportation monitoring using Python?
Given how simple it is to deploy a Telegram bot, we can easily use this solution to incorporate a lightweight tracking tool into their processes at a low cost.
In this article, we will design and deploy a transportation tracking tool using a Python Telegram bot.
I. Limitation of TMS & Tracking Tools
1. Scenario
2. What kind of obstacles can you face?
II. What do we need here?
III. What is a Telegram Bot?
1. Definition
2. How do you interact with a Telegram Bot?
IV. Create your Tracking Assistant Bot
1. Standard Operating Procedure (SOP)
V. Demo: Shipment Delivery confirmation
1. Step 1: DRIVER opens telegram and starts a discussion with BOT
2. Step 2: DRIVER shares its GPS Location (= Store Location)
3. Step 3, 4 and 5: Confirmation of the delivery with pictures
VI. Design your bot
VII. Conclusion
1. Add a Container Loading Optimization ModuleWhat are the limitations of commercial tracking tools?
Imagine that you support a medium-sized retailer operating in a market where the transportation industry is immature.
They want to implement a Transport Management System (TMS) from an external provider to achieve full visibility and real-time tracking of their shipments.
What kind of obstacles can they face?
- System Interface: if they have multiple carriers (with different systems), it can become expensive
- Maturity of Carriers: What if they manage their fleet with manual processes (Excel)?
- Limited Capacity to Negotiate: if you are a small customer for them, carriers may refuse to adapt their processes and use your system to record status
That is why this article proposes a light solution that probably answers your needs.
What do we need here?
A simple, cheap and easy-to-implement solution to track your shipments that
- Does not require additional IT development for your carriers
- Easily integrates into the current transportation processes
- Reduces admin workload for your logistics team
- Does not impact drivers’ productivity
- Does not require additional equipment
- Provides visibility, real-time tracking and transparency
What is a Telegram Bot?
Telegram
Telegram is a cross-platform, secure, convenient messaging app that works on all devices.
With over 500 million users worldwide, Telegram has an open API and free protocol.
With this API, we can build our tools, including a bot.
What’s a Bot?
A bot is a 3rd-party application that can interact with users by sending them messages, commands, and inline requests.
With Telegram, you can design and control your Telegram bot by sending HTTPS requests to its bot API.
Your bot can send/receive messages, photos, videos, and GPS locations — enough to build our shipment-tracking tool.
How do you interact with a Telegram Bot?
Add him and start a conversation :)
Create your Tracking Assistant Bot
Standard Operating Procedure(SOP)
For the first version of our bot, let’s use a light version of SOP to record delivery time.
Confirm Unloading at Destination
- STORE TEAM finished unloading your shipment from the truck
- DRIVER shares the shipment number, GPS location and a picture of the shipment with your Telegram BOT to confirm delivery
- Telegram BOT sends a delivery notification by email to your logistics team with the information listed above
Demo: Shipment Delivery confirmation
Your shipment has been unloaded in your store.
DRIVER wants to send delivery confirmation before leaving for his next destination.
Step 1: DRIVER opens Telegram and starts a discussion with the BOT
Step 2: DRIVER shares its GPS Location (= Store Location)
Step 3: DRIVER shares a delivery number
Step 4: DRIVER shares a picture of the shipment
Step 5: Your logistics teams receive a shipment confirmation
🏫 Discover 70+ case studies using Python and VBA to automate manual tasks 🤖 and optimize your supply chain 🚚 in this Cheat Sheet
Implementation
The initial version was using Python, but actually it can be done with many tools.
Create your bot with n8n
For a customer who wanted a no-code solution, I have replicated the solution with n8n.
With n8n, he can change the parameters and understand the logic behind.
Never heard about the no-code automation tool n8n? I have a tutorial for that.
In this tutorial, you will learn how to use my template collection that includes this Telegram bot.
What if you want to use Python?
Create your bot using Python
The initial implementation was using Python.
It is very easy as Telegram has a specific library to create bots (interracting with its API).
Find the source code in this repository 👇
Conclusion
This is a very light version to show the potential of what can be done with a Telegram Bot.
This can be improved with
- Real-Time GPS Location Tracking
- Add scanning function (Bar Code/QR Code) to avoid manual entry of delivery number by DRIVER.
- A function to get store and driver comments in case of late delivery?
- Seals management in case of shipping sensitive goods
About Me
Let’s connect on Linkedin and Twitter, I am a Supply Chain Engineer who uses data analytics to improve logistics operations and reduce costs.
For consulting or advice on analytics and sustainable supply chain transformation, feel free to contact me via Logigreen Consulting.
If you are interested in Data Analytics and Supply Chain, look at my website.
💌 New articles straight in your inbox for free: Newsletter
📘 Your complete guide for Supply Chain Analytics: Analytics Cheat Sheet
