Daily Sales-Performance Alerting
Joins counsellor rosters, walk-in logs and live MCube telephony data, computes role-specific call targets and escalates below-target agents to their managers automatically.
My role: Built the data joins, target arithmetic and escalation mail
- Role-specific targets
- 3
- Daily run
- 20:00 IST
- Branches covered
- 13
Every night this joins a staff roster, a walk-in log and a live telephony feed, works out who missed their call target, mails them with their manager copied, and sends the operations lead one roll-up. It replaced a manager opening a spreadsheet each evening and reading down a column.
Targets adjust for work the phone system cannot see
A flat call quota punishes whoever was busiest. An agent who spent the afternoon with walk-in visitors made fewer calls because they were doing the job.
So the target is the role quota minus an allowance for each walk-in handled that day. Role quotas differ because the roles differ — someone whose whole day is outbound calling carries a much higher number than a team lead who mostly supervises. Without per-role quotas the report is noise: the same people appear every night for structural reasons, and everyone stops reading it.
The roster is the spine of the join
This is the part that is easy to get wrong. The join runs from the roster, not from the call data. An agent missing from the telephony feed is recorded as zero calls, not excluded.
Driving the join from the call feed instead would mean an agent who made no calls at all has no row in the feed, and therefore never appears in the report. The worst performer becomes invisible — precisely the case the report exists to surface.
Two related rules follow. Calls under thirty seconds do not count, because without a floor a run of instant redials inflates a total to target without a single conversation. And an unknown role is skipped rather than given a default quota, because a guessed target produces a mail accusing someone of missing a number nobody set.
Exception reporting
Individual mail goes only to people below target. Everyone else gets nothing.
Silence is the signal. A "you met your target" mail every night trains people to filter the sender, and then the one message that matters gets filtered too.
The operations lead gets a single summary either way, including a positive line when nobody missed. That is one recipient who has actually asked for the daily number, and who needs to be able to tell "everyone hit target" apart from "the workflow did not run".
Failure handling
Both mail steps continue on error, so one malformed address in the roster cannot stop the rest of the run. The telephony fetch retries three times, because a single upstream blip should not cost the whole night's report.
What it had to get right
- Surface the agent who made zero calls, not just the ones who made some
- Adjust targets for walk-in work the phone system cannot see
- Stay silent for everyone who met target, so the mail keeps meaning something
- Survive one bad address in the roster without losing the rest of the run
Built with
- n8n
- MCube API
- Google Sheets
- Gmail
Want something like this built?
Get in touch