Recovering Queued Responses
Recover unanswered WhatsApp and Instagram conversations after a temporary interruption.
Last updated
Recover unanswered WhatsApp and Instagram conversations after a temporary interruption.
Zaia automatically retries failed Agent response generation on WhatsApp and Instagram.
This protects conversations from transient processing failures and service interruptions.
The mechanism combines fast queue processing with durable recovery tracking.
Recovery applies when the chat owner sends a message through WhatsApp or Instagram.
It does not apply when the chat has an active human-support ticket.
Zaia creates or updates a durable recovery record when it receives the message.
It then queues the chat for Agent response generation.
Recovery is automatic. No workspace configuration is required.
When generation starts, Zaia acknowledges the queued item and records the attempt.
If a retryable error occurs, Zaia waits 30 seconds before retrying.
Zaia performs one automatic retry. A response therefore has at most two attempts.
After the limit, Zaia preserves the final error and marks recovery as failed.
Most transient generation errors trigger the automatic retry.
Zaia does not retry these errors:
NotFound
PreconditionFailed
BadImplementation
LLM provider errors that do not require an alert
Before retrying, Zaia removes artifacts from the failed attempt.
It deletes the response placeholder from the chat.
It marks the previous execution as a failed attempt.
It ends stale running executions as failed.
This prevents orphaned placeholders, duplicate primary executions, and incorrect usage counts.
Zaia uses an in-memory queue for immediate coordination.
It also stores recovery state in the database. This lets retries survive restarts and deployments.
A recovery uses these states:
Pending — waiting to run or retry.
Processing — response generation is in progress.
Completed — the Agent generated the response.
Failed — the retry budget was exhausted.
Zaia locks recovery by chat and thread. Only one recovery can process that conversation window.
If a recovery remains processing for 30 minutes, a scheduler attempts to recover it.
Recovery cannot restore messages that fail before initial persistence.
Last updated
