08Implemented workflow
AI Sales Agent.
A Telegram Business sales assistant with catalog-grounded replies and seller takeover controls.
Overview
AI Sales Agent connects Telegram Business conversations to an n8n workflow. It retrieves product, stock, shipping, and payment information from PostgreSQL, synchronized from Google Sheets, then uses Gemini to compose a grounded customer reply.
Technology
Key features
- Telegram Connected Business replies inside customer conversations
- Transactional catalog and policy synchronization from Google Sheets
- Grounded LLM responses with a deterministic fallback
- Private owner controls and automatic pause on seller takeover
Engineering approach
- Nginx receives Telegram webhooks. The master n8n workflow authenticates and deduplicates incoming updates in PostgreSQL.
- Separate subworkflows handle owner controls, knowledge retrieval, response generation, and catalog synchronization.
- A final authorization gate checks conversation state before sending through the Telegram Business connection.
Challenges and solutions
- Seller takeover can occur while a reply is being generated. A two-phase authorization check revalidates state before dispatch.
- Failed catalog synchronization preserves the last valid PostgreSQL snapshot.