Library / Chatbots & Messaging Bots
Chatbots & Messaging Bots
Answer finance questions from Xero via WhatsApp, Telegram, Slack, and OpenAI
When an API call/webhook arrives, it answers chat messages with a bot with OpenAI / ChatGPT using Data Table, Slack, Telegram.
What it does
## Finance Bot - WhatsApp & Telegram, powered by Xero + OpenAI ### How it works Receives WhatsApp (via WAHA) and Telegram messages, verifies WAHA requests, normalizes the message, authorizes the sender, loads conversation state, and routes either a Slack-share follow-up or a new finance request. New requests are classified with OpenAI, matching Xero data is fetched, OpenAI words the answer (validated against the Xero figures), the state is saved, and the reply goes back through the originating channel. Read left to right: sections 1 to 10. ### Setup steps - Configure the WAHA webhook, base URL, session and HMAC SHA512 secret. - Connect Telegram bot credentials (trigger and send nodes). - Add OpenAI credentials (intent classifier and response writer). - Connect Xero OAuth2 credentials (connections, invoices, accounts, reports). - Connect Slack and set the target channel in the config node. - Create the n8n Data Table "Finance Bot Conversation State". - Update allowed users, channel IDs and tenant selection in "Set Workflow Config". ### Customization Adjust the allowed users, OpenAI prompts, supported intents, Xero filters/date windows, Slack sharing behaviour and fallback wording.
The steps
- Receive WhatsApp Message (WAHA Webhook)
- Compute WAHA HMAC-SHA512
- Is WAHA Signature Valid?
- Receive Telegram Message
- Normalize Channel Message
- Set Workflow Config (Users, Slack, Xero)
- Build Authorization Result
- Is User Authorized?
- Load Conversation State
- Merge Message with Saved State
- Prepare State Load Error Reply
- Determine Conversation Route
- Route: Slack Follow-up or New Request
- Prepare Slack Share Message
49 steps in total.
Similar automations
Finance, Invoices & AccountingSync Shopify orders to Xero invoices with Slack and email alerts12 stepsFinance, Invoices & AccountingValidate EN 16931 e-invoices from Gmail and create draft bills in Xero46 stepsFinance, Invoices & AccountingFetch Xero Accounting Data3 stepsFinance, Invoices & AccountingGet Invoices from Xero2 steps