← all cases

case 01 · AI agent SaaSin production

Multi-tenant AI agent platform on WhatsApp

Agents that answer, qualify and book for 40+ businesses. I led the architecture and system decisions, from design to production operations.

Context

The company puts AI agents on the WhatsApp lines of clinics, medical offices and sales teams. The agent answers the lead, qualifies them, books, reschedules, follows up, and hands off to a human when needed.

The system already ran on n8n and worked, but it was hitting the limits of visual automation at scale: fragile flows, requests returning empty, little observability, and no decent way to version or test changes. With dozens of clients in production, every tweak was a risk.

Architecture

I rebuilt the platform on Kestra, with code-first orchestration: everything is YAML, versioned in Git, validated in CI and published automatically.

Architecture: WhatsApp sends messages to Kestra, which runs the receiver and a 12-tool agentic loop, integrated with LLMs, Supabase, Chatwoot and calendars.whatsappcloud api · wahakestra · 3 namespaceswa-message-receiveragent-loop12 tools · typed i/ollmopenrouter · geminisupabasepostgres · rlschatwoothuman handoffcalendarsgoogle · amigo · gdsArchitecture: WhatsApp sends messages to Kestra, which runs the receiver and a 12-tool agentic loop, integrated with LLMs, Supabase, Chatwoot and calendars.whatsappcloud api · wahakestra · 3 namespaceswa-message-receiveragent-loop12 tools · typed i/ollmopenrouter · geminisupabasepostgres · rlschatwoothuman handoffcalendarsgoogle · amigo · gds
A message comes in through WhatsApp, goes through the receiver and the agentic loop, and reaches the integrations through adapters.

Decisions and challenges

Why leave n8n

I was already running everything on n8n. Moving to Kestra was about getting what visual automation can’t deliver at scale: versioned code, E2E tests, CI validation, real observability and deeper integrations. I went from flows that were hard to version and test to an auditable platform.

A duplicate message is a production bug

WhatsApp webhooks resend events, and a lead who gets the same reply twice notices right away. I implemented idempotency with an outbox and deduplication, which ended duplicate messages and empty-response requests.

Operating without deploys

Every client has its own prompt, and it changes all the time. I built versioned prompts (live/test) per project, editable from a custom dashboard. Tuning the agent’s behavior needs no deploy and no workflow changes.

The agent moves the pipeline too

With LeadTrack, the agent moves the lead through the sales pipeline and fires events automatically. Follow-ups and reminders are scheduled within each client’s business hours.

Results

Available for projects

Ready to put an agent into production?

Tell me about your operation. I reply within one business day.