The flow
Starts it 1Model 1Logic 17Service 7
The steps in the order they run, from what starts it.
- 1Trigger: Incoming Telegram MessageTelegram triggerStarts it
- 2Extract Telegram Message TextCodeLogic
- 3Lookup User State (Google Sheet)Google SheetsService
- 4Merge Incoming Message with StateMergeLogic
- 5Merge Updated State for Next StepMergeLogic
- 6Check if User Exists in DBIfLogic
- 7Carry Forward Previous AnswersSetLogic
- 8Map & Format Answer for Google SheetCodeLogic
- 9Insert New User into Google SheetGoogle SheetsService
- 10Update Answer in Google SheetGoogle SheetsService
- 11Extract Metadata from AnswerSetLogic
- 12Determine Next Quiz QuestionCodeLogic
- 13Append Full User State for ProcessingCodeLogic
- 14Check if More Questions RemainingSwitchLogic
- 15Is Q7 Answered?IfLogic
- 16TelegramTelegramService
- 17Fetch CardsGoogle SheetsService
- 18Clean Q1–Q7 InputsSetLogic
- 19Get Question TextCodeLogic
- 20Merge User Profile & Card DatasetMergeLogic
- 21Send QuestionTelegramService
- 22Build GPT Prompt with User Profile & Card DataCodeLogic
- 23Send Prompt to GPT for Card MatchingOpen AiModel
- 24Clean GPT Output & Split into SectionsCodeLogic
- 25Format GPT Card Recommendations for TelegramCodeLogic
- 26Send Card Recommendations to TelegramTelegramService