DMS Pro Tracker
A Feishu (Lark) bot that turns a parcel sortation center's live data into hourly progress reports, capacity alerts and on-demand answers for supervisors. It was the first employee-built integration with GOFO's internal system (DMS), and it's in daily use.
The problem
At GOFO's sortation center, supervisors needed to know through every shift how many parcels each destination had sorted, how close each one was to its truck capacity, and when it would finish. Getting that meant someone opening the DMS, copying numbers into a spreadsheet and posting updates by hand, every hour, while running a floor of 200+ contract workers.
I went through a formal review to get management approval for an integration with the DMS, then built this bot on it. The results led the company to open API access to internal staff, and it's now used by 30+ employees.
What it does
- Hourly progress reports. Five minutes past each hour, it pulls totals for the shift and posts a bilingual (Chinese and English) report to the operations groups. Branch lines and main lines appear separately, with packages, pallet labels and progress against each destination's capacity target. If nothing moved since the last report, it updates the logs silently instead of posting a duplicate.
- Capacity alerts. Every 15 minutes it checks quietly and alerts the group once when a destination passes 90% of capacity, so the team can prepare to close it out before the truck overflows.
- Weekday and Saturday targets. Capacity targets differ by day. Admins can change them for good (
!edit perm) or just for today's shift (!edit temp) from chat, with no code changes, because targets live in a JSON config. - Shift-aware time. A shift runs past midnight, so the bot treats 6 AM as the day boundary: overnight numbers count toward the shift they belong to.
- Second-round carry-over.
!r2records packages left over from the previous day's second round, and reports show them as “today + carried over = total”. - Records. Every run updates a monthly Excel master log (one column per hour) and a shared Feishu spreadsheet, and it can render the report as an image.
Commands
| Command | What it does |
|---|---|
!update · !supdate | Live report now, to every group or just this chat |
!lookup DEST | Live, bag-level count for one destination since the shift started |
!eta DEST | Estimated finish time from the last hour's sorting speed |
!edit perm|temp DEST N | Change a capacity target (admins only) |
!r2 DEST N | Record carried-over second-round packages |
!pause · !resume | Stop or restart the automatic reports (admins only) |
!ping · !help | Health check and command list |
❯ @DMS Pro Tracker !eta DEST01
⏱️ DEST01 ETA
🚀 Speed: 4,200 pkgs/hr
📦 Remaining: 9,800
⏰ Finish: 03:20 AM🚨 DEST02 reached 90.4% · 54,240 / 60,000 · get ready to close out
How it's built
- Fast, safe webhook. Feishu retries any event that isn't answered quickly, so the webhook returns 200 immediately, processes the message in a background thread, and drops duplicates by message ID. It only acts on commands that @mention the bot or arrive by direct message.
- Two data paths. Scheduled reports use the DMS's aggregated totals.
!lookuppulls the raw bag list and aggregates it itself, which gives a more granular, up-to-the-minute count. - State that survives restarts. Targets, temporary edits and carry-over counts are saved to small JSON files keyed by shift date. Credentials come from environment variables, never the code.
- ETA from velocity. Each run remembers the previous hour's totals, so
!etadivides the remaining packages by packages per hour.
Python · Flask · pandas · schedule · openpyxl · requests · Feishu Open API · ngrok. The code is private because it connects to company systems; this page describes it without internal details.
Impact
- Reclaims about 10 minutes per hour for each member of a 10-person team, roughly 17% of working time, that used to go to manual reporting.
- Showed the value of API access: the company then opened DMS API access to internal staff, now used by 30+ employees.
- Part of why I was promoted to department manager within eight months.
History
It started as a simpler stat tracker for the sorting group, then grew into DMS Pro Tracker v2 in April 2026, when I moved the core into a single service (main.py) with real-time fetching for manual updates and threshold checks. I still maintain and extend it.