Auto-Resolve & Idle Countdown

When a customer goes silent after an agent replies, Mahadata can close the conversation automatically instead of leaving it open in the queue forever. Agents don’t need to remember to mark each conversation as resolved.
The flow has two phases (both optional):
- Warning phase — N minutes before the resolve deadline, send a message like “Are you still there? We will close this in X minutes.” to the customer and mark the conversation as warned.
- Resolve phase — at the deadline, set the conversation status to
resolved, optionally send a closing message, and trigger post-resolution actions (e.g., a CSAT survey).
Configuration — Settings → Auto Resolve
Section titled “Configuration — Settings → Auto Resolve”Per-tenant configuration:
| Field | Meaning | Typical value |
|---|---|---|
| Enabled | Master toggle | On |
| Idle minutes | Time since the agent’s last reply before the conversation is auto-resolved | 30 |
| Warning minutes | Time before the resolve point when the warning message is sent (set to 0 to skip the warning) | 5 |
| Queued Timeout (minutes) | Idle time for conversations in the queue (not yet picked up by an agent) before being closed automatically | 1440 (24 hours) |
| Warning message | Template/text “Are you still there?” that the customer sees before resolution | ”We haven’t heard from you. We will close this conversation in {'{{warning_minutes}}'} minutes.” |
| Resolve message | Closing template/text sent upon resolution (optional) | “Closing this conversation. Reply anytime to reopen.” |
| Excluded tags | Conversations tagged with any of these are NEVER auto-resolved | KOMPLAIN |
One per line auto_resolve_configs per client_account_id.
How the timeout is calculated
Section titled “How the timeout is calculated”The countdown starts from the agent’s last reply (last_agent_reply_at). The auto-resolve sweeper runs every 2 minutes and looks for conversations that:
- Tenant has auto-resolve active
- Conversation status
open - The most recent message in the conversation was sent by the agent
- The agent’s last reply is older than
idle_minutes
Only conversations that meet all four conditions are resolved. Conversations that have an excluded tag (for example, KOMPLAIN) is skipped.
When the chip is displayed
Section titled “When the chip is displayed”The inbox displays a small Jam + Xm (and a red “Overdue” pill) on the conversation row only when the agent is the latest sender AND the conversation is open AND auto-resolve is configured for the tenant. The chip then counts down toward last_agent_reply_at + idle_minutes.
If the customer replies, the chip disappears — the conversation is now in the agent-action phase (waiting for the agent), not the customer-idle phase. Auto-resolve never runs while the customer is the latest sender.
When the agent replies again, the chip reappears with a new last_agent_reply_at that are new.
Excluded scenarios — when the sweeper intentionally skips a conversation
Section titled “Excluded scenarios — when the sweeper intentionally skips a conversation”The sweeper will NOT auto-resolve a conversation when any of these is true:
| Reason | Where |
|---|---|
| Auto-resolve is not enabled for the tenant | auto_resolve_configs.enabled = false |
| Conversation is already closed | conversations.status != 'open' |
| The customer’s reply is the latest message | conversations.last_message_sender_type != 'agent' |
| The agent has never replied | conversations.last_agent_reply_at IS NULL |
The conversation has a tag KOMPLAIN (or another tag marked in the configuration) | tag membership |
All of this is by design — agents are not ignoring customers in these cases.
Warning vs resolve — two-phase behavior
Section titled “Warning vs resolve — two-phase behavior”When warning_minutes > 0, the sweeper does this on every pass:
- Calculate
batas_peringatan = sekarang - (idle_minutes - warning_minutes) menit - Calculate
batas_idle = sekarang - idle_minutes menit - If
last_agent_reply_at <= batas_idle→ resolve the conversation (Phase 2) - If
last_agent_reply_at <= batas_peringatanAND not yet warned → send a warning message and stampauto_resolve_warned_at(Phase 1)
A conversation is warned at most once per agent-reply cycle. If the customer replies after the warning, auto_resolve_warned_at is reset when the agent next replies.
When warning_minutes = 0, the warning phase is skipped — the sweeper only resolves at idle_minutes.
Side effects of resolution
Section titled “Side effects of resolution”When a conversation is resolved automatically, the platform:
- Configure
conversations.status = 'resolved'and stampresolved_at - Send
resolve_messagethat is configured (if any) via the same channel last used by the customer - Resolving the linked live ticket on the conversation (lifecycle coupling) — the ticket moves to the Resolved status without requiring a disposition code; disposition codes are only requested when agents manually resolve the conversation from the inbox. Tickets that are already resolved/closed are not touched
- Publish event
events.conversation.auto_resolvedfor downstream consumers (KPI counters, CSAT triggers, etc.) - Triggering a CSAT/NPS/CES survey if the tenant has an active survey (customer replies do not reopen the conversation — see Customer Surveys)
- The conversation leaves the active inbox queue
CSAT responses arriving within the survey window are captured and stored in the conversation timeline (visible to agents reviewing the conversation later) without reopening the conversation.
Reading the inbox countdown chip
Section titled “Reading the inbox countdown chip”The chip on each conversation row in the inbox list reflects time relative to the auto-resolve deadline:
| Visual | Meaning |
|---|---|
| Hidden | The customer is the most recent sender (waiting for agent), OR there is still plenty of time, OR the feature is not active, OR last_agent_reply_at null |
Dim gray pill (5j 12m) | More than warning_minutes remaining; the conversation is in the customer-idle phase |
Amber pill, blinking (24m) | Inside the warning window — auto-resolve is approaching |
| Red pill, “Overdue” | Past the deadline. The sweeper runs every 2 minutes — within that window the conversation will soon be resolved |
Refresh interval: the chip recalculates every 30 seconds.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Possible cause | Solution |
|---|---|---|
| Conversation stays open past the idle limit | Auto-resolve is not enabled in configuration | Settings → Auto Resolve → enable |
| Conversations with the KOMPLAIN tag are not auto-resolved | By design — complaint conversations require manual closing | If unintended, remove the tag |
| Resolve message not sent | The channel does not allow free-form messages outside the customer service window (CSW) | Move the closing text to a template marked AUTHENTICATION or UTILITY |
| Auto-resolve sweep fails in the worker-scheduler logs | Database error, event publish error, or last_inbound_phone_number_id missing on the conversation | Check the logs worker-scheduler for specific errors |
| Sweep runs but nothing changes | All open conversations are in the agent-action phase (the customer replied last), or all are tagged KOMPLAIN, or idle_minutes has not been reached | Check via SQL: SELECT count(*), last_message_sender_type FROM conversations WHERE status = 'open' GROUP BY last_message_sender_type |
| ”Overdue” chip stays red for more than 2 minutes | The sweeper is not running, or the sweep failed for that conversation | Check the worker-scheduler logs + DB: confirm auto_resolve_configs.enabled = true and the conversation has no excluded tags |
Glossary
Section titled “Glossary”| Term | Definition |
|---|---|
idle_minutes | Total time after the agent’s last reply before auto-resolve runs |
warning_minutes | Time before the resolve point when the warning is sent. 0 disable the warning phase |
last_agent_reply_at | Timestamp of the agent’s most recent message on this conversation |
last_message_sender_type | Who sent the most recent message: agent, contact, bot, system, or supervisor_whisper |
| Timestamp when the warning was sent. Used to prevent duplicate warnings within a single cycle | |
| Sweeper | Background loop in worker-scheduler that runs the resolve logic every 2 minutes |