Connect data sources

WhatsApp

Automata provisions one Evolution API instance per WhatsApp connection. Pairing, chat listing, and sending use Evolution; message reading and search use its PostgreSQL datastore directly.

What you need

  • Evolution API v2.3.7, Redis, and PostgreSQL
  • A generated EVOLUTION_API_KEY
  • Matching NUXT_EVOLUTION_ADMIN_KEY
  • A read-only NUXT_EVOLUTION_DATABASE_URL for message reads and search
  • A webhook URL reachable from Evolution

Create a dedicated read role in the Evolution database:

CREATE ROLE wamcp_search LOGIN PASSWORD '<strong-password>';
GRANT CONNECT ON DATABASE evolution TO wamcp_search;
GRANT USAGE ON SCHEMA public TO wamcp_search;
GRANT SELECT ON "Message" TO wamcp_search;

Start the WhatsApp stack

pnpm services:up:whatsapp
pnpm dev

Confirm Evolution at http://localhost:8080 and the app at http://localhost:3000.

Pair an account

Create a WhatsApp account connection, continue to the QR code, then scan it from WhatsApp → Settings → Linked devices → Link a device.

Wait for the dashboard to report the connection as open before creating a token. A scoped send is refused when Automata cannot verify a recipient because the account is disconnected.

Message history

read-messages and search-messages require NUXT_EVOLUTION_DATABASE_URL. Without it, pairing, chat listing, and sending still work, but read tools return a missing-prerequisite response.

Full history is offered only while a device is linked. Before scanning, keep DATABASE_SAVE_DATA_HISTORIC=true; Automata creates new instances with full-history sync enabled. To import history for an older connection, use Import full history, then rescan the QR code.

Bring your own Evolution

Select Use my own Evolution API server and provide both the server origin and its global key. Automata never fills a missing half from the deployment default, and it never sends one server key to another server.

A bring-your-own connection also needs a database URL for that Evolution server before message read tools can work. Automata validates that the database contains a readable "Message" table before saving it.

View source