Conversational AI · WhatsApp · Voice · Production
Hader
A commercially deployed, multi-tenant communications platform where the difficult work is not producing text. It is attributing asynchronous events to the correct organization, preventing automation from speaking over a person, and turning conversations and calls into recoverable business operations.
The operating problem
Business conversations do not begin and end with a chatbot response. They become orders, bookings, follow-ups, support cases, staff interventions, contact updates, and records that other systems need to understand.
Hader brings those activities into one operating model while preserving a clear boundary between automated actions and human control.
My role and ownership
Hader was a team system built with Tayseer Laz and the engineering team at Aligned Tech; I was not its sole architect. My strongest individual ownership was at its integration boundaries.
I implemented the multi-tenant voice integration from Hader’s side, including line-to-organization resolution, tenant-specific call configuration, call and transcript persistence, order and booking submission, payment-link handoff, retry safety, abandoned-call cleanup, tests, and production hardening. I also implemented the later WhatsApp Coexistence work around webhook durability and attribution, versioned consent, handset-reply capture, and suppression of conflicting automated replies.
I contributed contact synchronization, provenance, Alinia federation, deployment fixes, system documentation, and the final engineering handover. The product and source remain employer-owned; this page describes publishable mechanisms without exposing code, client records, prompts, credentials, or infrastructure.
What the system supports
- Conversational automationTenant-specific assistants, approved business context, structured actions, and escalation rules.
- WhatsApp operationsMessaging workflows that preserve the existing business phone experience while connecting platform automation.
- Human handoffExplicit intervention states so staff can take control and automation can pause under defined rules.
- Orders and bookingsConversation-driven intake connected to structured operational records and follow-up workflows.
- Contact synchronizationConsistent contact identity across messaging, phones, and connected organizational systems.
- Consent and provenanceOperational boundaries around imported information, system actions, and the origin of customer data.
Technical implementation
The useful unit of analysis is one inbound event. Before Hader can generate anything, it has to establish who owns the event, whether it has already been processed, whether automation is still allowed to act, and whether any proposed business operation can be committed safely.
Execution trace: from webhook to an operational result
- Authenticate the original request. The channel signature is checked against the raw request bytes. Re-serializing the payload before verification would change the bytes and make the check unreliable.
- Resolve ownership from channel evidence. The callback address is treated as routing context, not sufficient proof of tenant ownership. Phone and channel metadata are matched to the organization that actually owns the connection.
- Make receipt durable. Recognized messages are deduplicated using provider identity, direction, and organization scope. Unrecognized subscribed event types are parked before the endpoint acknowledges them, preserving a recoverable source event.
- Create or recover conversation state. The contact, thread, message, delivery state, and source channel are reconciled inside tenant scope. A uniqueness race during thread creation is handled by recovering the row created by the competing request.
- Evaluate suppression gates. Hader checks deployment and feature state, opt-out and block state, channel state, message age, explicit staff takeover, and whether a handset reply has already answered this particular customer message.
- Build a grounded decision outside the database transaction. The model receives approved tenant data, while long-running inference is kept outside the short database transaction. Deterministic validators inspect the response and any proposed action.
- Commit business state before claiming success. Orders and bookings must exist as structured records before the customer is told they were created. Server-side state, rather than a model-emitted total or marker, remains authoritative.
- Deliver and reconcile asynchronously. Delivery status, retryable work, notifications, and downstream events continue through background processing. The persisted inbound message remains available even when inference or delivery fails later.
Hard problem: a callback URL is not tenant identity
Embedded channel onboarding introduced an attribution problem that does not appear in a single-tenant webhook. A newly connected number can begin delivering through an application-level callback before its tenant-specific callback is the effective route. That means the organization named in the URL and the organization that owns the phone channel can legitimately differ.
My first implementation parked unhandled event fields, but review exposed two failure modes: the write was started without being awaited, and the callback-addressed tenant was being treated as the owner. A successful HTTP response could therefore precede durable storage, while a valid event could be credited to the wrong organization.
I changed the boundary in two ways. First, the system records both the callback context and the independently resolved channel owner rather than collapsing them into one identity. Second, parking is awaited before acknowledgment; if persistence fails, the endpoint returns a retryable failure instead of a success that would make the event unrecoverable. Ordinary message traffic bypasses this landing path and retains its normal deduplication flow.
This is intentionally a capture first, interpret later design. It adds storage and replay work, but it converts unknown event shapes from silent data loss into observable backlog. It also avoids guessing when an account-level payload lacks enough phone-level metadata to attribute safely.
- Alternative rejected: trust the tenant in the callback path
- It is simpler, but onboarding can route a valid event through a callback belonging to a different organization. Transport routing and data ownership are separate facts.
- Alternative rejected: acknowledge, then store in the background
- It reduces webhook latency, but a process or database failure after the response loses events the provider may never resend. Durability belongs before acknowledgment for non-repeatable payloads.
- Accepted tradeoff: preserve unresolved events
- Some events cannot be attributed from the metadata available. Hader retains them without assigning them speculatively; the implementation does not claim a complete consumer for every parked event type.
Hard problem: a person can answer while the model is still generating
Portal handoff is straightforward to model as durable conversation state: taking over a thread pauses automation until an explicit resume action. WhatsApp Coexistence creates a different race. A business owner can reply from the handset without creating a portal user action, including during the several seconds in which an automated draft is being generated.
Treating that handset reply as an assignment would be semantically false because no Hader user took ownership. Muting the thread forever would also be wrong because a later customer message may need automation again. I introduced a separate, forward-only handset-reply timestamp and compare it with the timestamp of the inbound customer message being considered. An older redelivery cannot move that state backward, and a new customer message is not suppressed by an unrelated historic reply.
The echo is also persisted as an operator-originated message so the inbox and reporting do not claim it as bot work. For the narrower in-flight race, the echo invalidates the active generation token; the sender checks that token again after generation and discards a superseded draft. Durable conversation state remains the long-lived guard, while fast invalidation narrows the window in which concurrent work can become stale.
This mechanism does not turn delivery into an exactly-once system. Provider retries are expected, event ordering is imperfect, and active-draft cancellation depends on a coordination layer. The design contains those conditions with forward-only state, message deduplication, and a final supersession check rather than assuming events arrive once and in order.
Voice is a distributed integration, not a second product database
The real-time call service is kept outside Hader’s core request process because audio transport and conversational latency have a different failure profile from business records. The boundary is narrow: the dialed line resolves to one organization; Hader returns bounded, tenant-specific configuration and structured order or booking fields; the call service reports lifecycle events and invokes typed business operations.
The write contract tolerates retries and reordering. Call start is idempotent, transcript turns are unique within a call sequence, call end is write-once, and retrying an order for the same call returns the existing order instead of creating a second one. A worker closes calls that never receive a terminal event. These rules let the call transport retry without duplicating the customer’s operational record.
Orders, bookings, payment requests, and customer history still belong to Hader. The voice service does not receive a parallel source of truth or direct database ownership. This capability is deployed and used by active clients, but client identities, call volumes, and operating metrics are not published.
What the evidence supports
Repository history. My commits implement the voice gateway and multi-tenant phone configuration, order and booking submission, payment-link handoff, caller continuity, call cleanup, and targeted hardening. Later commits implement durable webhook parking, correction of tenant attribution, versioned consent gates, handset-reply capture, and automated-reply suppression.
Automated verification. The repository includes tests for voice authentication and organization scoping, phone-integration isolation, retry-safe call and order behavior, webhook signatures, tenant isolation, row-level policy drift, consent decisions, and related domain validators. Database uniqueness constraints provide the final deduplication boundary where concurrent requests can outrun application checks.
Operational verification. Voice changes were deployed and exercised in active use. The repository also documents deployment health checks, migrations, rollback behavior, and a formal handover. Those artifacts support implementation and operational ownership; they do not establish a public uptime, latency, model-accuracy, or autonomous-resolution metric.
Status and capability boundary
Voice AI is implemented inside Hader and connects live telephone calls with its conversation, order, booking, payment, transfer, and call-record workflows. It is deployed in active client use as a supporting Hader capability, not as a standalone product.
Hader is commercially deployed and used by active, paying client organizations. Client identities, counts, and operating metrics remain confidential under NDA.