Enhance Personal Finance with N8N WhatsApp Bot IntegrationEnhance Personal Finance with N8N WhatsApp Bot Integration
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
N8N WhatsApp Financial Bot — Portfolio Explanation Overview This workflow is a WhatsApp-based personal finance bot built in N8N. Users interact with it by sending text commands directly via WhatsApp, and the bot responds with debt tracking, income recording, and financial reports — all stored in a PostgreSQL database.
Integrations Used IntegrationPurposeEvolution API + WhatsAppReceives and sends WhatsApp messagesPostgreSQLStores debts, income records, and financial dataN8N Code NodesParses commands and formats responsesWebhookEntry point for incoming messages
Flow Breakdown 0. Setup — Create Tables
Criar tabelas (executar 1x)
A one-time PostgreSQL node that creates the necessary database tables before the flow goes live. Run once during setup.
Webhook (Entry Point)
Webhook
Configured with the Evolution API to receive all incoming WhatsApp messages via HTTP POST. Setup requires pointing the Evolution instance's Webhook URL to this node and subscribing to the messages.upsert event.
Extract Message
Extrair mensagem
A Code node reads the Evolution API's JSON payload and extracts:
The message text (lowercased) The sender's phone number The sender's name from WhatsApp
Security Filter — My Number Only
Filtro — só meu número
A security gate that only allows messages from the owner's own number to proceed. Any message from an unknown number is silently ignored and a 200 OK is returned to avoid retries.
Switch — Command Detection
Switch — comando
Routes the flow based on the command detected in the message: CommandActionmenuShows the options menudividaDebt registration flowrecebiIncome registration flowrelatorioFinancial report flow(anything else)Fallback / ignored
Menu
Menu Montar
Generates and sends a formatted options menu to the user via WhatsApp, listing all available commands with usage examples.
Parse Debt Command
Parsear dívida
Extracts structured data from the /divida command. Expected format: /divida [name] [value]
Parse Income Command
Parsear receber
Extracts structured data from the /recebi command. Expected format: /recebi [name] [value]
8 & 9. Save to PostgreSQL
Salvar dívida / Salvar receber
Inserts the parsed debt or income record into the PostgreSQL dividas table, using the configured financial database credentials (host, port, database, user, password).
Fetch Report
Buscar relatório
Runs a PostgreSQL query that returns a financial summary including:
Total debts per person Total income received per month Breakdown by fortnight (installment periods)
11a/b/c. Format Messages
Formatar mensagens / Confirmar dívida / Confirmar receber / Formatar relatório
Three formatting nodes — one per command path — that shape the response into WhatsApp-friendly Markdown (bold, line breaks, currency formatting like R$ 1.000,00).
Send WhatsApp Response
Enviar WhatsApp
Sends the formatted reply back to the user via the Evolution API HTTP endpoint: POST http://{SEU_HOST}/message/sendText/{INSTANCE} with the API key in the request header.
Respond to Webhook
Responder ao Webhook
Returns an HTTP 200 response to the Evolution API to confirm the message was successfully processed and prevent retry loops.
Available Commands (User-Facing) CommandDescription/menuShows all available commands/divida [name] [value]Registers a debt owed to you/recebi [name] [value]Logs a payment received/relatorioGenerates a full financial summary report
Key Features
✅ WhatsApp-native interface — no app needed, just chat commands ✅ Owner-only security filter — private and protected by default ✅ Multi-command routing — clean switch logic for each feature ✅ PostgreSQL persistence — all financial data stored reliably ✅ Formatted reports — human-readable summaries with WhatsApp Markdown ✅ Webhook handshake — proper HTTP 200 handling to prevent duplicate triggers ✅ Zero UI required — fully operated through natural WhatsApp messages
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started