A website enquiry arrives at 4:55 p.m. The CRM sends an automatic acknowledgement immediately. A salesperson replies at 9:06 a.m. the next morning. A dashboard that uses the acknowledgement timestamp reports a response time of zero minutes, even though the lead waited until the next day for a person to respond.
This workflow measures the time from enquiry capture to the first qualifying human response. It uses DynamoDB to store the timestamps, AWS Lambda to apply the rules, and Amazon EventBridge Scheduler to trigger a deadline check.
1. Define the clock before building the dashboard
Store capturedAt , assignedAt , and firstHumanResponseAt separately. This lets you distinguish the time a lead spent waiting for assignment from the time the assigned team took to respond.
Choose what qualifies as a response. For this example, a salesperson’s outbound email or a connected call qualifies. Automated confirmations, internal notes, and unconnected calls are recorded separately. Use the activity’s occurrence time for the metric and keep its ingestion time for troubleshooting delayed CRM events.
Track two measures if the team works fixed hours:
- Elapsed response time measures how long the prospect waited.
- Business-hours response time measures time inside the assigned team’s working calendar.
2. Calculate one deadline and keep it visible
Assume the team works 9 a.m. to 5 p.m. local time and has a 15-business-minute target. A lead captured at 4:55 p.m. uses five minutes that day. The remaining ten minutes resume at 9 a.m. on the next working day, so the deadline is 9:10 a.m.
Event | Local time |
|---|
Enquiry captured | Monday, 4:55 p.m. |
Lead assigned | Monday, 4:57 p.m. |
First human response | Tuesday, 9:06 a.m. |
Response deadline | Tuesday, 9:10 a.m. |
The lead waited 16 hours and 11 minutes in elapsed time and 11 business minutes. It met the illustrative 15-minute target.
Store timestamps in UTC and calculate deadlines from a named time zone and a defined holiday calendar. In this policy, reassignment keeps the original deadline. The alert goes to whoever owns the lead when the deadline check runs.
3. Make the scheduled check safe to repeat
Save dueAt and the policy version on the lead. Create a one-time schedule that invokes a Lambda check with the lead ID and expected deadline. Keep the schedule creation recoverable by periodically finding leads with a deadline but no recorded schedule.
When the check runs, Lambda reads the current lead and evaluates whether a qualifying response occurred by the deadline. If the lead still appears overdue, create an alert record using a stable key such as leadId + dueAt + policyVersion . Use a conditional write so repeated invocations create one alert record. Deliver the alert from that record and keep delivery status separate.
If the CRM sends an on-time response event late, reconcile the alert and reporting status using the event’s occurrence time. A brief grace period can reduce false alerts when the CRM regularly takes time to deliver activity events.
4. Check that the metrics explain the delay
Test enquiries received after hours, leads moved between owners, duplicate CRM activity, and an on-time response that arrives after the deadline check. Confirm that an automatic acknowledgement leaves the human response clock running.
Report median and 90th-percentile response time for leads with a recorded response. Show the percentage of eligible leads that missed the deadline alongside those figures, including leads that remain unanswered. Break out capture-to-assignment and assignment-to-response time so the team can see whether the delay starts in routing or follow-up.
Loading article