A message arrives at 2 a.m. on a Saturday. By Monday morning it is buried under forty others, and the customer has already bought from someone who answered on Sunday. You do not find out until they write a one-star review. The fix is not a faster inbox — it is a single queue that every channel feeds, that drafts replies by template, and that hands a human only the cases a human actually needs.
Here is what you get at the end: one list of requests, each tagged with its source channel, each either auto-answered or parked in a "needs a human" lane. You will see it working when a test message sent to email and a test message sent to a messenger land side by side in the same list within seconds, and when a message that matches no template shows up flagged rather than silently answered.
This guide walks the build in order, names who owns each step, and tells you where the thing breaks. It assumes you are building with an AI coding agent or handing it to a developer — not buying a helpdesk subscription.
The shape of the project before you write a line
Three moving parts, and it pays to name them now because every later decision hangs off them.
Ingest — something that receives a message from each channel and turns it into one common record. Email and messenger behave nothing alike here, and that mismatch is where most of the pain lives.
Triage — classification and a draft reply. This is where the model does real work: sorting a request into a category and writing a first draft from a template. It is also where you must not let it act unsupervised.
Delivery — send the auto-reply, or route to a human with the context attached. The routing rule is a decision a person makes once; the code just enforces it. More on the topic: “Auto-reply to messenger requests with queuing and payment: wiring an n8n bot, a spreadsheet and a payment webhook in one evening”.
A warning before you start: the messenger channel is the one people underestimate. Email has had decades of tooling. A chat platform's webhook can retry, can deliver twice, can arrive out of order. If your first version treats both channels identically, duplicates and lost attachments will be your first bugs.
Step 1 — Decide the matching rule (human, no AI)
Before any code, write down which inquiries get an automatic reply and which never do. This is a business decision, not a technical one, and an AI agent cannot make it for you.
A workable split for a small team:
- Auto-reply, no human: order status, opening hours, how to reset a password, where to find an invoice.
- Draft for a human to approve: refunds, complaints, anything mentioning money or a legal threat.
- Straight to a human, no draft: messages from named accounts, anything the classifier is unsure about.
If you skip this step and let the model decide on the fly, you will eventually auto-reply to a cancellation request with a cheerful "thanks for reaching out." Decide the rule on paper first. It is a fifteen-minute conversation that saves a week of cleanup.
Step 2 — Get the access before you build (human, then AI)
Access is the step that stalls projects, because some of it you cannot get at all. Sort your channels into three buckets.
Email — usually fine. For a mailbox you control, IMAP and SMTP are enough and need only the address and an app password. For Gmail or Microsoft 365, an app password or OAuth depending on the account's security settings — check the provider's current documentation, because these change. If you are on a shared hosting mailbox, ask the host whether IMAP is enabled; some disable it by default.
Messenger — depends entirely on the platform. Most major chat platforms offer a bot API with webhooks, and you register a bot to get a token. The catch: many require a business verification, a review, or a public HTTPS endpoint before the webhook will fire. Plan for that review time. If a platform has no bot API at all, you cannot read its messages programmatically — say so plainly and use email or a manual export for that channel instead of pretending it will work.
A place to run it. A small server with a public HTTPS address, because webhooks need one. A free-tier host often works for testing.
Hand this list to your AI agent as a checklist. It can write the integration code against the documented API, but it cannot click through a verification screen or accept terms for you.
Step 3 — Build the common record and the ingest (AI builds, human tests)
One record shape for every message, regardless of source. Keep it minimal: source channel, external message id, sender, subject or chat title, body text, attachment references, timestamp received, and a processing status.
The single most important field is the external message id — the platform's own id for that message. It is what lets you reject duplicates later. Do not generate your own id and throw the platform's away.
For email, fetch new messages over IMAP on a short interval or via the provider's push notification if it has one. For the messenger, receive the webhook payload and parse out the fields the platform's docs define — check the docs for exact field names, they differ per platform.
Your AI agent can write both adapters. What it cannot do is know your platform's payload shape without the docs in front of it, so paste the relevant API reference into the prompt.
Step 4 — Classify and draft (AI drafts, human approves the rules)
Classification: send the message text to a model with your categories from Step 1 and ask for a category plus a confidence. Draft: for categories marked auto-reply, ask the model to fill a template from your knowledge base rather than write freely.
Two rules that keep this sane:
- Templates, not free prose, for auto-replies. A filled template is predictable and reviewable. A free-written reply to a refund question is a liability.
- Low confidence goes to a human. Set a threshold and route anything below it to the needs-a-human lane. You will tune the threshold by watching real messages, not by guessing.
Step 5 — Route and reply (AI sends, human checks the log)
Auto-reply categories go out immediately through the channel's send API. Everything else lands in the needs-a-human lane with the original message, the suggested category, and any draft attached.
Every send and every route writes a log line: message id, channel, decision, timestamp. That log is what you will read when someone asks "did this get answered?" — and someone will.
Where it breaks, and what to do about each
Duplicates from webhook retries. Chat platforms retry a webhook if your endpoint does not answer quickly, and sometimes deliver the same event twice. Without a guard you send two replies to one customer. Fix: store the external message id with a uniqueness constraint, and drop any event whose id you have already seen. This is the single highest-value line of code in the whole project. More on the topic: “Customer Support Myths: Why "The Customer Is Always Right" Fails and How to Handle Angry Customers Without Inflating Repeat Contacts”.
Lost attachments. A messenger may send a file as a URL that expires, or an email may carry an attachment name that your parser mangles. If you store only the URL, the file is gone when you need it. Fix: download attachments to your own storage at ingest time and store a local reference, not the platform link.
Webhook races. Two events for the same conversation can arrive nearly simultaneously and be processed out of order, so a reply goes out before the message it answers is saved. Fix: process events for one conversation in order — a per-conversation queue or a lock — rather than in parallel.
There is a fourth, quieter risk: personal data. Customer messages contain names, addresses, sometimes payment details. Know where they are stored and for how long, and keep that consistent with your data protection obligations — under the GDPR, for instance, that means a lawful basis and a retention limit. This is a decision for a human, not the agent.
How to check that nothing was left unanswered
Run these by hand before you trust the system.
| Scenario | What you do | Success sign |
|---|---|---|
| Same message twice | Send one test message, then replay the same webhook event | Exactly one record, one reply |
| Both channels at once | Send to email and messenger within a minute | Two records, same queue, correct source tags |
| Unmatched message | Send something that fits no template | It lands in the human lane, not auto-answered |
| Attachment | Send an email and a chat file | Both files downloaded and openable |
| Out-of-order | Trigger two webhook events close together | Replies go out in the right order |
| The audit | Pick a random past day, count inbound vs. answered plus queued | The two numbers match |
The audit row is the one that matters most. Once a week, count what came in against what went out or is waiting. If the numbers match, no request is lost. If they do not, you have found the gap before a customer did.
What it costs in time and money
Time: a working single-queue version is a few focused days for someone comfortable with APIs — a day for email, a day or two for the messenger including the platform's review, a day for classification and routing, a day for the tests above. The platform verification wait is often the longest part and is out of your hands.
Money, in rough order of magnitude: a small server or free tier, a model API bill that scales with message volume (small for a few hundred messages a day), and your time. No invented per-message prices here — check current model pricing against your own volume. The real cost is the review time on the messenger side and the tuning of the confidence threshold, both of which are human hours.
If building this yourself is not where you want to spend the week, asibiont.com takes such projects on turnkey — the developer names the price and you top up the balance, so the integration, the queue, and the routing rules arrive built rather than as a to-do list.
The part people skip
The build is not the hard part. The hard part is the weekly audit and the threshold tuning that follow it, because a queue nobody checks is just a tidier way to lose messages. Set a recurring fifteen minutes to read the log, adjust the categories, and confirm the inbound and answered counts still match. That habit, more than any model, is what keeps a request from going unanswered.
If you would rather not build it yourself: we take such a project on — you describe the task, we build it and bring it to a working result, and the developer names the price. The payment goes through a balance top-up on the payment page.