Automation
Overview
Three features under src/modules/automation: AI workspace, voice agent, and WhatsApp agent. They are feature-flagged or credential-gated and easy to misconfigure.
AI workspace
Routes under /automation/ai, plus voice and ops routes. Schema: 71-ai.prisma (AiConversation, AiMessage, AiToolCall, AiUsageLog, and the voice models).
AI_WORKSPACE_ENABLED must be the string true or routes fail closed with ai.error.workspaceDisabled. Daily token budget 0 disables the limit (example env comment).
Tools include confirm-before-write behavior described in the API README. Embeddings listen for product.content.changed. The embedding service catches its own failures so API boot does not require Bifrost.
Voice
VoiceAgentConfig, VoiceCall, VoiceCallEvent. STT and TTS URLs default to local Faster-Whisper (localhost:9000) and Kokoro (localhost:8880). Twilio credentials can be stored encrypted on the agent. Voice webhooks are VERSION_NEUTRAL.
WhatsApp
Schema: 70-conversation.prisma. Agents, templates, messages, Meta catalog mapping, cart items, sessions.
Webhooks are public. The env comment says unsigned payloads are rejected when META_APP_SECRET is unset, not accepted. Catalog provisioning queue: whatsapp-catalog-provisioning / provision-catalog.
WhatsApp is a seeded channel type. It is not registered by the marketplace class-name regex. Ordering goes through the agent and meta-commerce.
Flow: WhatsApp inbound. Integration page: WhatsApp.
Code map
| Piece | Path |
|---|---|
| AI | src/modules/automation/ai |
| Voice | src/modules/automation/voice-agent |
src/modules/automation/whatsapp-agent | |
| Meta catalog client | src/integrations/meta-commerce |
Failure scenarios
AI routes 403 until the flag is exactly true. WhatsApp webhooks fail closed without META_APP_SECRET. Voice STT/TTS are not in the first lines of Compose. If those URLs are down, calls fail at the provider. Fallback behavior was not catalogued.