Answer finance questions from Xero via WhatsApp, Telegram, Slack, and OpenAI

Go to Workflow
0 views
Built by Intuz Intuz
Created on October 05, 2026

Description

Quick overview
This workflow answers finance questions received on WhatsApp (via WAHA) or Telegram by fetching data from Xero, drafting a validated response with OpenAI, optionally posting the result to Slack, and persisting conversation state in an n8n Data Table.

How it works
Receives an incoming message from WhatsApp via a WAHA webhook (with HMAC verification) or from a Telegram bot trigger.
Normalizes the incoming message into a consistent format, applies workflow configuration, and blocks unauthorized senders based on an allowed-users list.
Loads the prior conversation state from an n8n Data Table and decides whether the message is a Slack-share follow-up (Yes/No/post) or a new finance request.
For new requests, uses OpenAI to classify the intent (accounts receivable, cash position, or bills due this week) and replies with help text if the intent is unknown.
Retrieves the connected Xero organisations, selects the correct Xero tenant, and queries the relevant Xero endpoints to build a canonical text summary for the requested report.
Uses OpenAI to rewrite the canonical Xero summary as a concise chat response and validates it against the canonical numbers before asking whether to post the update to Slack.
Saves the updated conversation state and sends the reply back to the originating channel (WhatsApp via WAHA or Telegram), posting the previous answer to Slack if the user confirms.

Setup
Connect credentials for Xero OAuth2, OpenAI, Slack, and Telegram, and add HTTP Header Auth credentials for the WAHA send API.
Configure WAHA to send message events to the workflow’s webhook URL and set the matching HMAC SHA-512 secret and WAHA base URL.
Create an n8n Data Table named “Finance Bot Conversation State” with columns for stateKey, userId, channel, chatId, lastIntent, lastResponse, and pendingSlackConfirmation.
Update the workflow configuration values for allowed users, the Slack channel ID, and (if you have multiple Xero organisations) the Xero tenant ID.

Additional info
Connect with us:
Website: https://www.intuz.com/n8n-workflow-automation-templates/
Email: [email protected]
LinkedIn: https://www.linkedin.com/company/intuz

For Custom Workflow Automation
Get Started: https://n8n.partnerlinks.io/intuz

Nodes Used (6)

Code
n8n-nodes-base.code
Crypto
n8n-nodes-base.crypto
HTTP Request
n8n-nodes-base.httpRequest
OpenAI
@n8n/n8n-nodes-langchain.openAi
Slack
n8n-nodes-base.slack
Telegram
n8n-nodes-base.telegram