A customer submits your enquiry form. Your database saves the lead, but the notification service times out. The browser retries. Now the sales team has two records and still no clear owner.
That is a useful place to start an automation project. Before adding a model to classify the enquiry, make sure the enquiry survives an ordinary failure.
This is a design note from Comenzar Technologies in Chandigarh. The examples are illustrative; they do not describe a client deployment or measured results.
Keep the receipt separate from the extra work
Treat receiving an enquiry and enriching it as separate responsibilities. A reasonable first design is:
- Validate the submission on the server.
- Store the enquiry and a durable task to process it.
- Return a receipt only after the storage operation succeeds.
- Let a worker attempt notifications, classification or drafting.
- Make failed tasks visible to an owner.
If the lead and its processing task live in the same transactional database, writing both in one transaction can avoid the gap where a lead exists but its follow-up task never does. A separate queue introduces its own delivery guarantees and failure cases; choose those deliberately.
Give repeated submissions a stable identity
A retry should not automatically become a new business event. Generate a submission identifier once for an attempt, reuse it on network retries and enforce the appropriate uniqueness rule in storage.
Do not use a phone number alone as your deduplication key. The same person may have a second, legitimate enquiry.
Here is the shape of the operation, expressed as pseudocode:
receive(submission_id, validated_fields):
begin transaction
if submission_id already exists:
return the existing receipt
insert enquiry(submission_id, validated_fields, status="received")
insert work_item(submission_id, task="prepare_handoff", status="queued")
commit
return receipt(submission_id)
The exact transaction and response behavior depends on your database and application framework. In a real implementation, account for concurrent requests as well as a simple sequential retry; a read-before-insert check by itself is not a concurrency guarantee.
Write down what success means
“Notification attempted” and “someone owns the lead” are different states. Useful states might be received, queued, assigned, awaiting review and failed. Keep timestamps and enough error information for diagnosis without dumping customer messages or credentials into logs.
For downstream side effects, use an idempotency mechanism where the receiving service supports one. Otherwise, decide how your worker detects or tolerates a repeat. A worker can crash after an email is sent but before it records success.
Set retry limits and a route for manual recovery. An invisible queue that keeps retrying forever is not a dependable handoff.
Add AI where the result is reviewable
Once the record and handoff are reliable, a model might summarise the free-text request or suggest a category. Keep the original message available. Treat the generated output as a suggestion, not a new source of truth.
An enquiry can contain instructions written by a stranger. Do not let that text grant permissions, change your workflow rules or trigger privileged actions. Limit the information the model receives and keep pricing, unusual commitments and customer-facing replies behind the right review step.
If a simple rule assigns the enquiry correctly, use the rule. You do not need a model to copy a phone number into a record.
Test the awkward path first
Try a duplicate submission identifier, a disconnected notification provider, an empty message, a worker restart and a failed assignment. Check what the customer sees and what the person responsible for follow-up can recover.
For the business-side decision—what to automate, how to judge the pilot and which costs to ask about—we wrote a separate AI automation guide for small businesses.
The first useful outcome does not have to be dramatic. Every genuine enquiry recorded once, with a clear owner and a recoverable failure path, is a solid start.
Top comments (0)