💬 Collect astrology feedback with Telegram and Supabase
⚡ 0 views · 💬 Support Chatbots
Description
Quick Overview
This workflow runs a Telegram bot that guides users through a multi-step chat flow, stores session state in Supabase, logs completed astrology reading requests to a Supabase history table, and replies to the user in Telegram.
How it works
- Receives incoming messages and callback queries from Telegram.
- Looks up the sender’s session in a Supabase
sessionstable using the Telegram chat ID. - Evaluates the user’s message against the current session state to choose the next prompt, update stored inputs, and decide whether the interaction is complete.
- Updates the existing Supabase session record or inserts a new one when the chat ID has no prior session.
- When a reading flow is marked complete, inserts a record into the Supabase
astrology_readingstable with the captured input details. - Sends the generated reply back to the user in Telegram using HTML parse mode.
Setup
- Create a Telegram bot with BotFather, add your Telegram credentials in n8n, and configure the workflow’s Telegram trigger to use that bot.
- Add Supabase API credentials in n8n and ensure you have
sessionsandastrology_readingstables with fields matchingchat_id,state,mode,p1_data, andp2_data. - Update the Supabase table names/field mappings in the Supabase nodes if your schema differs from the workflow defaults.
🔗 Nodes Used
Telegram, Telegram Trigger, Supabase
📥 Import
Download workflow.json and import into n8n:
Workflow menu → Import from File