{"workflow":{"id":13655,"name":"Run WhatsApp quizzes and track student progress with Wati, GPT-4.1 and Sheets","views":19,"recentViews":0,"totalViews":19,"createdAt":"2026-02-24T12:32:32.152Z","description":"Turn WhatsApp into an interactive personal classroom. This workflow automates the entire learning cycle—from generating AI-powered quizzes to tracking student progress in real-time—by combining WATI, OpenAI AI Agents, and Google Sheets.\n\n---\n\n## 🎯 What This Workflow Does\n\nProvides a complete end-to-end educational experience through simple WhatsApp commands:\n\n- 📝 **Interactive Quiz Trigger**  \n  Student sends a topic (e.g., `quiz photosynthesis`) via WATI Trigger to start a session.\n\n- 🚦 **Intelligent Command Routing**  \n  A Route Message switch node detects specific student intents:\n  - **quiz:** Triggers the AI generation of new questions.\n  - **answer:** Routes to the evaluation engine to grade student replies.\n  - **progress:** Triggers the historical performance report branch.\n\n- 👁️ **AI-Powered Content Creation**  \n  An AI Agent using GPT-4o generates 3 tailored MCQ questions based on the requested topic, formatted as structured JSON.\n\n- 📊 **Automated Grading & Logging**\n  - **Evaluation:** Compares student replies (e.g., `answer 1a 2b 3c`) against stored correct answers fetched from Google Sheets.\n  - **Logging:** Saves the final score, topic, and date to the master database.\n\n- 📈 **Progress Visualization**  \n  Fetches all historical scores to calculate average performance, identifies the \"Best Topic,\" and generates a visual progress bar.\n\n---\n\n## ✨ Key Features\n\n- **Dynamic AI Tutoring:** Quizzes are never repetitive; the AI generates fresh questions every time a topic is requested.\n- **Session Management:** Uses a \"Session Key\" (Phone + Date) to ensure students can only take one specific quiz per day per topic.\n- **Visual Performance Feedback:** Students receive formatted reports with emojis and visual bars (`███░░`) to track their improvement.\n- **Easy Answer Format:** Simple shorthand for students (e.g., `1a 2b`) makes it accessible for mobile-first learning.\n- **Centralized Database:** All academic data is logged in Google Sheets, making it easy for teachers or parents to monitor results.\n\n---\n\n## 💼 Perfect For\n\n- **Students:** Quick self-testing on subjects before exams or competitive tests.\n- **Teachers:** Providing an automated \"homework bot\" for students to practice curriculum topics.\n- **Corporate Trainers:** Deploying bite-sized knowledge checks to employees via mobile.\n- **Language Learners:** Testing vocabulary or grammar rules on the go.\n\n---\n\n## 🔧 What You'll Need\n\n### Required Integrations\n\n- **[WATI](https://www.wati.io/)** – To handle WhatsApp message triggers and automated feedback delivery.\n- **OpenAI API** – For the AI Agent and Chat Model (GPT-4o) to generate quizzes.\n- **Google Sheets** – To act as the database for active quiz sessions and permanent score history.\n\n### Optional Customizations\n\n- **Difficulty Levels:** Adjust the AI Agent's system message to generate \"Beginner,\" \"Intermediate,\" or \"Advanced\" quizzes.\n- **Timed Challenges:** Use n8n Wait nodes to send \"Time's Up\" reminders if a student hasn't answered within an hour.\n\n---\n\n## 🚀 Quick Start\n\n1. **Import Template** – Copy the JSON and import it into your n8n instance.\n2. **Set Credentials** – Connect your WATI, OpenAI, and Google Sheets accounts.\n3. **Setup Spreadsheet** – Create two sheets:\n   - **Active Quizzes:** Headers for `sessionKey`, `phone`, `topic`, `correctAnswers`, `questionCount`, `today`.\n   - **Scores:** Headers for `date`, `phone`, `senderName`, `topic`, `score`, `total`, `percentage`.\n4. **Start Learning** – Send `quiz solar system` to your WhatsApp bot to begin!\n\n---\n\n## 🎨 Customization Options\n\n- **Question Count:** Modify the AI prompt and code nodes to generate 5 or 10 questions instead of 3.\n- **Persona Tweak:** Change the System Message in the AI Agent to make the tutor sound like a \"Fun Scientist\" or a \"Strict Professor\".\n- **Filtered Progress:** Edit the Build Progress Report code to show reports for only the last 30 days.\n\n---\n\n## 📈 Expected Results\n\n- 100% automated quiz generation and grading—no manual teacher intervention required.\n- Immediate student feedback providing correct answers for missed questions.\n- Increased engagement through a familiar, low-friction WhatsApp interface.\n- Actionable insights into which topics students struggle with most.\n\n---\n\n## 🏆 Use Cases\n\n### Exam Preparation\nA high school student uses the bot to drill on \"Biology\" and \"History\" topics daily, tracking their score increase over time via the `progress` command.\n\n### Employee Onboarding\nA new hire receives a \"Company Policy\" quiz via WhatsApp; their score is automatically logged for HR compliance.\n\n### Community Education\nAn NGO uses the bot to teach health and safety protocols in rural areas where WhatsApp is the primary digital tool.\n\n---\n\n## 💡 Pro Tips\n\n- **Strict JSON:** The AI Agent is prompted to return only JSON to ensure the workflow doesn't crash on conversational filler.\n- **Flexible Matching:** The Build Progress Report node uses `String()` casting to ensure phone numbers match correctly even if formatted differently in Sheets.\n- **Topic Extraction:** Use specific topics for best results; \"Photosynthesis\" works better than just \"Biology\".\n\n---\n\nReady to launch your AI classroom? Import this template and connect your OpenAI key to start generating quizzes today!","workflow":{"meta":{"instanceId":"277842713620d9f5554de3b1518b865a152c8c4db680008bd8aec536fc18b4a8","templateCredsSetupCompleted":true},"nodes":[{"id":"011057a0-718e-4c13-86da-fc4af6db18ec","name":"📋 Flow Overview","type":"n8n-nodes-base.stickyNote","position":[-224,-672],"parameters":{"width":560,"height":628,"content":"## 🎓 WhatsApp Learning Assistant – Quiz Generator & Progress Tracker\n\n**How it works:**\n1. Student sends a topic e.g. *quiz math* on WhatsApp via WATI\n2. Switch routes message by keyword command\n3. OpenAI generates 3 MCQ questions on that topic\n4. Student replies with answers e.g. *answer 1a 2b 3c*\n5. Score calculated, saved to Google Sheets, feedback sent back\n6. Student types *progress* anytime to see score history\n\n**Credentials needed:** WATI, OpenAI API Key (Header Auth), Google Sheets OAuth2"},"typeVersion":1},{"id":"d652bc1d-16a9-495a-9a32-288e97b9e4b8","name":"Sticky – Trigger & Route","type":"n8n-nodes-base.stickyNote","position":[528,16],"parameters":{"color":7,"width":370,"height":510,"content":"### 1️⃣ Trigger & Route\n**WATI Trigger** listens for incoming WhatsApp messages.\n**Route Message Switch** detects the command keyword:\n- Starts with `quiz` → generate quiz flow\n- Starts with `answer` → evaluate answers flow\n- `progress` → fetch score history\n- Anything else → send help message"},"typeVersion":1},{"id":"abd16359-1519-470b-9583-c6168bae51b0","name":"Sticky – Quiz Generation","type":"n8n-nodes-base.stickyNote","position":[960,-128],"parameters":{"color":7,"width":1254,"height":382,"content":"### 2️⃣ Quiz Generation\n**Extract Topic Code** parses the topic from the message.\n**AI Agent** generates 3 MCQ questions with options A-D and correct answers.\n**Format Quiz Code** parses the AI response, formats for WhatsApp and saves quiz session to Google Sheets.\n**WATI – Send Text Message** delivers the formatted report back to the student."},"typeVersion":1},{"id":"95713db8-e5cb-4f3a-98ff-06d2ba5e438c","name":"Sticky – Answer Evaluation","type":"n8n-nodes-base.stickyNote","position":[1024,304],"parameters":{"color":7,"width":966,"height":350,"content":"### 3️⃣ Answer Evaluation\n**Parse Answers Code** extracts student answers from message e.g. `answer 1a 2b 3c`.\n**Sheets – Read Quiz** fetches the stored quiz for this student.\n**Evaluate & Score Code** compares answers, calculates score and builds detailed feedback.\n**Sheets – Save Score** logs result: phone, topic, score, date.\n**WATI – Send Text Message** delivers the formatted report back to the student."},"typeVersion":1},{"id":"a55cbd2e-9c04-4e5a-8f13-0d2a9a50f20b","name":"Sticky – Progress Report","type":"n8n-nodes-base.stickyNote","position":[1056,720],"parameters":{"color":7,"width":626,"height":302,"content":"### 4️⃣ Progress Report\n**Sheets – Read Progress** fetches all score rows for this student's phone number.\n**Build Progress Report Code** calculates total quizzes, average score, best topic and recent history with visual bar.\n**WATI – Send Text Message** delivers the formatted report back to the student."},"typeVersion":1},{"id":"d29141aa-70fd-4dfa-91a7-1767ca92cc41","name":"Route Message","type":"n8n-nodes-base.switch","position":[736,288],"parameters":{"rules":{"values":[{"outputKey":"Quiz Request","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"7b75a712-fea7-46b3-8af0-0a958c50e381","operator":{"type":"string","operation":"startsWith"},"leftValue":"={{ $json.text }}","rightValue":"quiz "}]},"renameOutput":true},{"outputKey":"Submit Answer","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"34d4f348-48e4-4f4b-832f-af9c56b4f81b","operator":{"type":"string","operation":"startsWith"},"leftValue":"={{ $json.text }}","rightValue":"answer "}]},"renameOutput":true},{"outputKey":"Progress","conditions":{"options":{"version":1,"leftValue":"","caseSensitive":true,"typeValidation":"strict"},"combinator":"and","conditions":[{"id":"89f902f7-e331-4821-b8f8-e4dd476a4245","operator":{"type":"string","operation":"equals"},"leftValue":"={{ $json.text.toLowerCase() }}","rightValue":"progress"}]},"renameOutput":true}]},"options":{"fallbackOutput":"extra"}},"typeVersion":3},{"id":"a90b94dd-7da7-4afd-8e3a-6d77ebe0a734","name":"Extract Topic","type":"n8n-nodes-base.code","position":[1008,16],"parameters":{"jsCode":"// Extract Topic from Quiz Request\n// Input: 'quiz photosynthesis' or 'quiz world war 2'\nconst text = $json.text || '';\nconst phone = $json.waId || $json.from || 'unknown';\nconst senderName = $json.senderName || 'Student';\n\nconst topic = text.replace(/^quiz\\s+/i, '').trim();\nif (!topic) throw new Error('No topic provided.');\n\nconst today = new Date().toISOString().split('T')[0];\nconst sessionKey = `${phone}_${today}`;\n\nreturn { json: { phone, senderName, topic, sessionKey, today } };"},"typeVersion":2},{"id":"c9b1c12d-e189-46f1-8c62-dcac2d866169","name":"Format Quiz & Build Message","type":"n8n-nodes-base.code","position":[1520,0],"parameters":{"jsCode":"// Format Quiz & Build WhatsApp Message\n// Parses OpenAI response and formats quiz for WhatsApp display\n\nconst rawText = $json.output || '{}';\n\nlet quiz = {};\ntry {\n  quiz = JSON.parse(rawText);\n} catch (e) {\n  const match = rawText.match(/\\{[\\s\\S]*\\}/);\n  if (match) { try { quiz = JSON.parse(match[0]); } catch (e2) { quiz = {}; } }\n}\n\nconst phone = $('Extract Topic').item.json.phone;\nconst senderName = $('Extract Topic').item.json.senderName;\nconst topic = $('Extract Topic').item.json.topic;\nconst sessionKey = $('Extract Topic').item.json.sessionKey;\nconst today = $('Extract Topic').item.json.today;\nconst questions = quiz.questions || [];\n\nif (questions.length === 0) throw new Error('OpenAI did not return valid questions');\n\n// Build WhatsApp quiz message\nconst lines = [\n  `🎓 *Quiz Time, ${senderName}!*`,\n  `📚 *Topic: ${topic.toUpperCase()}*`,\n  '',\n  'Reply with: *answer 1X 2X 3X*',\n  'Example: *answer 1a 2c 3b*',\n  '━━━━━━━━━━━━━━━━━━'\n];\n\nconst correctAnswers = {};\nfor (const q of questions) {\n  lines.push('');\n  lines.push(`*Q${q.number}.* ${q.question}`);\n  lines.push(`  🅐 ${q.options.a}`);\n  lines.push(`  🅑 ${q.options.b}`);\n  lines.push(`  🅒 ${q.options.c}`);\n  lines.push(`  🅓 ${q.options.d}`);\n  correctAnswers[q.number] = q.correct.toLowerCase();\n}\n\nlines.push('');\nlines.push('━━━━━━━━━━━━━━━━━━');\nlines.push('⏱️ Reply with your answers now!');\n\n// Serialize correct answers: '1:a,2:c,3:b'\nconst answersString = Object.entries(correctAnswers).map(([n,a]) => `${n}:${a}`).join(',');\n\nreturn {\n  json: {\n    phone, senderName, topic, sessionKey, today,\n    quizMessage: lines.join('\\n'),\n    correctAnswers: answersString,\n    questionCount: questions.length\n  }\n};"},"typeVersion":2},{"id":"314bc871-8e7d-43e4-9ade-f13838691eeb","name":"Google Sheets – Save Active Quiz","type":"n8n-nodes-base.googleSheets","position":[1728,0],"parameters":{"columns":{"value":{"phone":"={{ $json.phone }}","today":"={{ $json.today }}","topic":"={{ $json.topic }}","sessionKey":"={{ $json.sessionKey }}","questionCount":"={{ $json.questionCount }}","correctAnswers":"={{ $json.correctAnswers }}"},"schema":[{"id":"sessionKey","type":"string","display":true,"required":false,"displayName":"sessionKey","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"topic","type":"string","display":true,"required":false,"displayName":"topic","defaultMatch":false,"canBeUsedToMatch":true},{"id":"correctAnswers","type":"string","display":true,"required":false,"displayName":"correctAnswers","defaultMatch":false,"canBeUsedToMatch":true},{"id":"questionCount","type":"string","display":true,"required":false,"displayName":"questionCount","defaultMatch":false,"canBeUsedToMatch":true},{"id":"today","type":"string","display":true,"required":false,"displayName":"today","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY/edit#gid=0","cachedResultName":"Active Quizzes"},"documentId":{"__rl":true,"mode":"list","value":"1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY/edit?usp=drivesdk","cachedResultName":"Untitled spreadsheet"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"d248438c-e50b-4d20-b547-f53be5b7e106","name":"Parse Student Answers","type":"n8n-nodes-base.code","position":[1104,480],"parameters":{"jsCode":"// Parse Student Answers\n// Input: 'answer 1a 2c 3b'\nconst text = ($json.text || '').trim();\nconst phone = $json.waId || $json.from || 'unknown';\nconst senderName = $json.senderName || 'Student';\n\nconst answerPart = text.replace(/^answer\\s+/i, '').trim();\nconst matches = answerPart.match(/([1-9][a-dA-D])/g);\n\nif (!matches || matches.length === 0) {\n  throw new Error('Could not parse answers. Format: answer 1a 2b 3c');\n}\n\nconst studentAnswers = {};\nfor (const match of matches) {\n  studentAnswers[parseInt(match[0])] = match[1].toLowerCase();\n}\n\nconst today = new Date().toISOString().split('T')[0];\nconst sessionKey = `${phone}_${today}`;\n\nreturn { json: { phone, senderName, sessionKey, today, studentAnswers } };"},"typeVersion":2},{"id":"395a0afa-1d20-4d17-9c24-b6980519ee7d","name":"Google Sheets – Read Active Quiz","type":"n8n-nodes-base.googleSheets","position":[1280,480],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":"gid=0","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY/edit#gid=0","cachedResultName":"Active Quizzes"},"documentId":{"__rl":true,"mode":"list","value":"1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY/edit?usp=drivesdk","cachedResultName":"Untitled spreadsheet"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"4cb5e7d9-ebe6-4e0c-9e9a-5b39b41065d6","name":"Evaluate & Calculate Score","type":"n8n-nodes-base.code","position":[1440,480],"parameters":{"jsCode":"// Evaluate Answers & Calculate Score\n// Compares student answers vs correct answers from Google Sheets\n\nconst parsedData = $('Parse Student Answers').item.json;\nconst { phone, senderName, sessionKey, today, studentAnswers } = parsedData;\n\n// Find matching quiz row\nconst allRows = $input.all();\nconst quizRow = allRows.find(r => r.json.sessionKey === sessionKey);\n\nif (!quizRow) {\n  return {\n    json: {\n      phone,\n      feedbackMessage: `⚠️ *No active quiz found!*\\n\\nYou haven't requested a quiz today yet.\\nSend *quiz <topic>* to start one!\\nExample: *quiz solar system*`,\n      score: 0, total: 0, topic: 'N/A', today, hasQuiz: false\n    }\n  };\n}\n\nconst topic = quizRow.json.topic;\nconst questionCount = parseInt(quizRow.json.questionCount) || 3;\n\n// Parse correct answers from '1:a,2:c,3:b'\nconst correctAnswers = {};\nfor (const pair of (quizRow.json.correctAnswers || '').split(',')) {\n  const [num, ans] = pair.split(':');\n  if (num && ans) correctAnswers[parseInt(num)] = ans.toLowerCase();\n}\n\n// Score calculation\nlet score = 0;\nconst resultLines = [];\nfor (let i = 1; i <= questionCount; i++) {\n  const studentAns = (studentAnswers[i] || '?').toLowerCase();\n  const correctAns = correctAnswers[i] || '?';\n  const isCorrect = studentAns === correctAns;\n  if (isCorrect) score++;\n  resultLines.push(`Q${i}: You answered *${studentAns.toUpperCase()}* ${isCorrect ? '✅' : `❌ (correct: ${correctAns.toUpperCase()})`}`);\n}\n\nconst percentage = Math.round((score / questionCount) * 100);\nlet performanceMsg = percentage === 100 ? '🏆 Perfect score! Outstanding!'\n  : percentage >= 66 ? '🌟 Great job! Keep it up!'\n  : percentage >= 33 ? '📖 Good effort! Review and try again!'\n  : '💪 Keep studying! You can do better!';\n\nconst feedbackLines = [\n  `📝 *Quiz Results – ${topic.toUpperCase()}*`,\n  '',\n  ...resultLines,\n  '',\n  '━━━━━━━━━━━━━━━━━━',\n  `🎯 *Score: ${score}/${questionCount} (${percentage}%)*`,\n  performanceMsg,\n  '',\n  'Type *progress* to see your full history!',\n  'Type *quiz <topic>* to try another quiz!'\n];\n\nreturn {\n  json: {\n    phone, senderName, topic, score,\n    total: questionCount, percentage, sessionKey, today,\n    feedbackMessage: feedbackLines.join('\\n'),\n    hasQuiz: true\n  }\n};"},"typeVersion":2},{"id":"24e96f7e-8fcd-4899-950b-f9dbed03eeb4","name":"Google Sheets – Save Score","type":"n8n-nodes-base.googleSheets","position":[1616,480],"parameters":{"columns":{"value":{"date":"={{ $json.today }}","phone":"={{ $json.phone }}","score":"={{ $json.score }}","topic":"={{ $json.topic }}","total":"={{ $json.total }}","percentage":"={{ $json.percentage }}","senderName":"={{ $json.senderName }}"},"schema":[{"id":"date","type":"string","display":true,"required":false,"displayName":"date","defaultMatch":false,"canBeUsedToMatch":true},{"id":"phone","type":"string","display":true,"required":false,"displayName":"phone","defaultMatch":false,"canBeUsedToMatch":true},{"id":"senderName","type":"string","display":true,"required":false,"displayName":"senderName","defaultMatch":false,"canBeUsedToMatch":true},{"id":"topic","type":"string","display":true,"required":false,"displayName":"topic","defaultMatch":false,"canBeUsedToMatch":true},{"id":"score","type":"string","display":true,"required":false,"displayName":"score","defaultMatch":false,"canBeUsedToMatch":true},{"id":"total","type":"string","display":true,"required":false,"displayName":"total","defaultMatch":false,"canBeUsedToMatch":true},{"id":"percentage","type":"string","display":true,"required":false,"displayName":"percentage","defaultMatch":false,"canBeUsedToMatch":true}],"mappingMode":"defineBelow","matchingColumns":[],"attemptToConvertTypes":false,"convertFieldsToString":false},"options":{},"operation":"append","sheetName":{"__rl":true,"mode":"list","value":916130242,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY/edit#gid=916130242","cachedResultName":"Scores"},"documentId":{"__rl":true,"mode":"list","value":"1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY/edit?usp=drivesdk","cachedResultName":"Untitled spreadsheet"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"f11f8afb-154e-4771-a5e8-98ee025d720d","name":"Google Sheets – Read Progress","type":"n8n-nodes-base.googleSheets","position":[1088,848],"parameters":{"options":{},"sheetName":{"__rl":true,"mode":"list","value":916130242,"cachedResultUrl":"https://docs.google.com/spreadsheets/d/1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY/edit#gid=916130242","cachedResultName":"Scores"},"documentId":{"__rl":true,"mode":"list","value":"1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY","cachedResultUrl":"https://docs.google.com/spreadsheets/d/1U_qWPXSk-WfGb3lCl_Gkb17h8K0qJr_DfPxsSZ1i8hY/edit?usp=drivesdk","cachedResultName":"Untitled spreadsheet"}},"credentials":{"googleSheetsOAuth2Api":{"id":"Kz2DdSp11rxqwlFt","name":"Google Sheets account - Deepanshi"}},"typeVersion":4.5},{"id":"15333ca7-f728-41be-b707-7cf186e7f3ba","name":"Build Progress Report","type":"n8n-nodes-base.code","position":[1296,848],"parameters":{"jsCode":"// Build Progress Report\n// Fetches all scores for this student and builds a summary\n\nconst phone =  $('Wati Trigger1').first().json.waId|| $('Wati Trigger1').json.from;\nconst senderName =  $('Wati Trigger1').first().json.senderName|| 'Student';\nconst allRows = $input.all();\nconst myRows = allRows.filter(r => String(r.json.phone) === String(phone));\n\nif (myRows.length === 0) {\n  return [{ json: {\n    phone,\n    progressMessage: `📊 *No quiz history yet, ${senderName}!*\\n\\nStart your first quiz:\\n*quiz <topic>*\\nExample: *quiz photosynthesis*`\n  }}];\n}\n\nconst totalQuizzes = myRows.length;\nconst totalScore = myRows.reduce((s, r) => s + (parseFloat(r.json.score) || 0), 0);\nconst totalQuestions = myRows.reduce((s, r) => s + (parseFloat(r.json.total) || 0), 0);\nconst avgPercentage = Math.round((totalScore / totalQuestions) * 100);\n\n// Best topic calculation\nconst topicMap = {};\nfor (const r of myRows) {\n  const t = r.json.topic || 'Unknown';\n  if (!topicMap[t]) topicMap[t] = { score: 0, total: 0 };\n  topicMap[t].score += parseFloat(r.json.score) || 0;\n  topicMap[t].total += parseFloat(r.json.total) || 0;\n}\nlet bestTopic = '';\nlet bestPct = 0;\nfor (const [topic, data] of Object.entries(topicMap)) {\n  const pct = data.total > 0 ? (data.score / data.total) * 100 : 0;\n  if (pct > bestPct) { bestPct = pct; bestTopic = topic; }\n}\n\n// Recent 5 quizzes\nconst recent = myRows.slice(-5).reverse();\nconst recentLines = recent.map(r => {\n  const pct = parseFloat(r.json.percentage) || 0;\n  const emoji = pct === 100 ? '🏆' : pct >= 66 ? '🌟' : pct >= 33 ? '📖' : '💪';\n  return `${emoji} ${r.json.topic} – ${r.json.score}/${r.json.total} (${pct}%) on ${r.json.date}`;\n});\n\n// Progress bar\nconst filled = Math.round(avgPercentage / 10);\nconst bar = '█'.repeat(filled) + '░'.repeat(10 - filled);\n\nconst lines = [\n  `📊 *Progress Report*`,\n  `👤 *${senderName}*`,\n  '',\n  `${bar} *${avgPercentage}% avg score*`,\n  '',\n  `📝 *Total Quizzes Taken:* ${totalQuizzes}`,\n  `✅ *Total Correct:* ${totalScore}/${totalQuestions}`,\n  `🏅 *Best Topic:* ${bestTopic} (${Math.round(bestPct)}%)`,\n  '',\n  '━━━━━━━━━━━━━━━━━━',\n  '*Recent Quizzes:*',\n  ...recentLines,\n  '',\n  'Type *quiz <topic>* to keep learning! 🚀'\n];\n\nreturn [{ json: { phone, progressMessage: lines.join('\\n') } }];"},"typeVersion":2},{"id":"cf7720eb-1a8d-4620-be7f-22d452f4180f","name":"Wati Trigger1","type":"n8n-nodes-wati.watiTrigger","position":[544,320],"webhookId":"ceb8d7d4-0ea8-4491-9bec-89f94a3feb35","parameters":{"event":"messageReceived"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1,"alwaysOutputData":true},{"id":"0dd92282-065f-47a1-8fca-a99326399b5b","name":"AI Agent","type":"@n8n/n8n-nodes-langchain.agent","position":[1168,0],"parameters":{"text":"=Generate a 3-question MCQ quiz about the topic: {{ $json.topic }}","options":{"systemMessage":"=\"You are a professional tutor. Generate a 3-question MCQ quiz. Return ONLY a valid JSON object with 'questions' containing 'number', 'question', 'options' (a,b,c,d), and 'correct'. Do not include any conversational text or markdown blocks like ```json.\""},"promptType":"define"},"typeVersion":3.1},{"id":"acafd240-d88c-444f-98a4-3fbabaa7eb2f","name":"OpenAI Chat Model","type":"@n8n/n8n-nodes-langchain.lmChatOpenAi","position":[1168,144],"parameters":{"model":{"__rl":true,"mode":"list","value":"gpt-4.1-mini","cachedResultName":"gpt-4.1-mini"},"options":{},"builtInTools":{}},"credentials":{"openAiApi":{"id":"8IkhtT3EbXygnvcr","name":"Mediajade"}},"typeVersion":1.3},{"id":"b16ab10c-284b-4d67-b1e3-084de2af1371","name":"Send Quiz","type":"n8n-nodes-wati.wati","position":[1952,0],"parameters":{"target":"={{ $json.phone }}","messageText":"={{ $('Format Quiz & Build Message').item.json.quizMessage }}ssage Text: ```markdown\n"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"592de9a8-28d1-4a77-a481-5cdcdc15f713","name":"Send Score","type":"n8n-nodes-wati.wati","position":[1792,480],"parameters":{"target":"={{ $json.phone }}","messageText":"={{ $('Evaluate & Calculate Score').item.json.feedbackMessage }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1},{"id":"029b3a0e-7e4f-414e-b023-fe48d93858ff","name":"Send Score1","type":"n8n-nodes-wati.wati","position":[1504,848],"parameters":{"target":"={{ $json.phone }}","messageText":"={{ $json.progressMessage }}"},"credentials":{"watiApi":{"id":"LeAm3lDk4hC1D2Qy","name":"wati - templates"}},"typeVersion":1}],"pinData":{"Wati Trigger1":[{"id":"699d87e6c54795957e88bbb8","data":null,"text":"Progress","type":"text","waId":"917024935915","owner":false,"created":"2026-02-24T11:13:42.296906Z","sourceId":null,"ticketId":"699d5bece335b461449f4b91","avatarUrl":null,"eventType":"message","forwarded":false,"listReply":null,"sourceUrl":null,"timestamp":"1771931621","assignedId":null,"senderName":"Deepanshi Singhal","sourceType":7,"buttonReply":null,"operatorName":null,"statusString":"SENT","operatorEmail":null,"conversationId":"699d5becb12153808a3300f0","messageContact":null,"replyContextId":"","whatsappMessageId":"wamid.HBgMOTE3MDI0OTM1OTE1FQIAEhggQUM2QkVBQTc5NkJFN0VCMzA1MjgwRjMwRUU4NTVBQ0MA","frequentlyForwarded":false,"interactiveButtonReply":null}]},"connections":{"AI Agent":{"main":[[{"node":"Format Quiz & Build Message","type":"main","index":0}]]},"Extract Topic":{"main":[[{"node":"AI Agent","type":"main","index":0}]]},"Route Message":{"main":[[{"node":"Extract Topic","type":"main","index":0}],[{"node":"Parse Student Answers","type":"main","index":0}],[{"node":"Google Sheets – Read Progress","type":"main","index":0}]]},"Wati Trigger1":{"main":[[{"node":"Route Message","type":"main","index":0}]]},"OpenAI Chat Model":{"ai_languageModel":[[{"node":"AI Agent","type":"ai_languageModel","index":0}]]},"Build Progress Report":{"main":[[{"node":"Send Score1","type":"main","index":0}]]},"Parse Student Answers":{"main":[[{"node":"Google Sheets – Read Active Quiz","type":"main","index":0}]]},"Evaluate & Calculate Score":{"main":[[{"node":"Google Sheets – Save Score","type":"main","index":0}]]},"Format Quiz & Build Message":{"main":[[{"node":"Google Sheets – Save Active Quiz","type":"main","index":0}]]},"Google Sheets – Save Score":{"main":[[{"node":"Send Score","type":"main","index":0}]]},"Google Sheets – Read Progress":{"main":[[{"node":"Build Progress Report","type":"main","index":0}]]},"Google Sheets – Read Active Quiz":{"main":[[{"node":"Evaluate & Calculate Score","type":"main","index":0}]]},"Google Sheets – Save Active Quiz":{"main":[[{"node":"Send Quiz","type":"main","index":0}]]}}},"lastUpdatedBy":1,"workflowInfo":{"nodeCount":21,"nodeTypes":{"n8n-nodes-base.code":{"count":5},"n8n-nodes-wati.wati":{"count":3},"n8n-nodes-base.switch":{"count":1},"n8n-nodes-base.stickyNote":{"count":5},"n8n-nodes-wati.watiTrigger":{"count":1},"n8n-nodes-base.googleSheets":{"count":4},"@n8n/n8n-nodes-langchain.agent":{"count":1},"@n8n/n8n-nodes-langchain.lmChatOpenAi":{"count":1}}},"status":"published","readyToDemo":null,"user":{"name":"Jitesh Dugar","username":"jiteshdugar","bio":"AI Automation Specialist - OpenAI, CRM & Automation Expert with a solid understanding of various tools that include Zapier, Make, Zoho CRM, Hubspot, Google Sheets, Airtable, Pipedrive, Google Analytics, and more.","verified":true,"links":["https://www.linkedin.com/in/jiteshdugar"],"avatar":"https://gravatar.com/avatar/edaa3abb99806b0586dced559d0a5417f24a507e7c4464a63960f0638a4b1b90?r=pg&d=retro&size=200"},"nodes":[{"id":18,"icon":"file:googleSheets.svg","name":"n8n-nodes-base.googleSheets","codex":{"data":{"alias":["CSV","Sheet","Spreadsheet","GS"],"resources":{"generic":[{"url":"https://n8n.io/blog/love-at-first-sight-ricardos-n8n-journey/","icon":"❤️","label":"Love at first sight: Ricardo’s n8n journey"},{"url":"https://n8n.io/blog/why-business-process-automation-with-n8n-can-change-your-daily-life/","icon":"🧬","label":"Why business process automation with n8n can change your daily life"},{"url":"https://n8n.io/blog/automatically-adding-expense-receipts-to-google-sheets-with-telegram-mindee-twilio-and-n8n/","icon":"🧾","label":"Automatically Adding Expense Receipts to Google Sheets with Telegram, Mindee, Twilio, and n8n"},{"url":"https://n8n.io/blog/supercharging-your-conference-registration-process-with-n8n/","icon":"🎫","label":"Supercharging your conference registration process with n8n"},{"url":"https://n8n.io/blog/creating-triggers-for-n8n-workflows-using-polling/","icon":"⏲","label":"Creating triggers for n8n workflows using polling"},{"url":"https://n8n.io/blog/no-code-ecommerce-workflow-automations/","icon":"store","label":"6 e-commerce workflows to power up your Shopify s"},{"url":"https://n8n.io/blog/migrating-community-metrics-to-orbit-using-n8n/","icon":"📈","label":"Migrating Community Metrics to Orbit using n8n"},{"url":"https://n8n.io/blog/automate-google-apps-for-productivity/","icon":"💡","label":"15 Google apps you can combine and automate to increase productivity"},{"url":"https://n8n.io/blog/your-business-doesnt-need-you-to-operate/","icon":" 🖥️","label":"Hey founders! Your business doesn't need you to operate"},{"url":"https://n8n.io/blog/how-honest-burgers-use-automation-to-save-100k-per-year/","icon":"🍔","label":"How Honest Burgers Use Automation to Save $100k per year"},{"url":"https://n8n.io/blog/how-a-digital-strategist-uses-n8n-for-online-marketing/","icon":"💻","label":"How a digital strategist uses n8n for online marketing"},{"url":"https://n8n.io/blog/why-this-product-manager-loves-workflow-automation-with-n8n/","icon":"🧠","label":"Why this Product Manager loves workflow automation with n8n"},{"url":"https://n8n.io/blog/sending-automated-congratulations-with-google-sheets-twilio-and-n8n/","icon":"🙌","label":"Sending Automated Congratulations with Google Sheets, Twilio, and n8n "},{"url":"https://n8n.io/blog/how-a-membership-development-manager-automates-his-work-and-investments/","icon":"📈","label":"How a Membership Development Manager automates his work and investments"},{"url":"https://n8n.io/blog/aws-workflow-automation/","label":"7 no-code workflow automations for Amazon Web Services"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlesheets/"}],"credentialDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/credentials/google/oauth-single-service/"}]},"categories":["Data & Storage","Productivity"],"nodeVersion":"1.0","codexVersion":"1.0"}},"group":"[\"input\",\"output\"]","defaults":{"name":"Google Sheets"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MCIgaGVpZ2h0PSI2MCI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGZpbGw9IiMyOEI0NDYiIGQ9Ik0zNS42OSAxIDUyIDE3LjIyNXYzOS4wODdhMy42NyAzLjY3IDAgMCAxLTEuMDg0IDIuNjFBMy43IDMuNyAwIDAgMSA0OC4yOTMgNjBIMTIuNzA3YTMuNyAzLjcgMCAwIDEtMi42MjMtMS4wNzhBMy42NyAzLjY3IDAgMCAxIDkgNTYuMzEyVjQuNjg4YTMuNjcgMy42NyAwIDAgMSAxLjA4NC0yLjYxQTMuNyAzLjcgMCAwIDEgMTIuNzA3IDF6Ii8+PHBhdGggZmlsbD0iIzZBQ0U3QyIgZD0iTTM1LjY5IDEgNTIgMTcuMjI1SDM5LjM5N2MtMi4wNTQgMC0zLjcwNy0xLjgyOS0zLjcwNy0zLjg3MnoiLz48cGF0aCBmaWxsPSIjMjE5QjM4IiBkPSJNMzkuMjExIDE3LjIyNSA1MiAyMi40OHYtNS4yNTV6Ii8+PHBhdGggZmlsbD0iI0ZGRiIgZD0iTTIwLjEyIDMxLjk3NWMwLS44MTcuNjYyLTEuNDc1IDEuNDgzLTEuNDc1aDE3Ljc5NGMuODIxIDAgMS40ODIuNjU4IDEuNDgy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40NzYgMCAwIDEtMS40ODItMS40NzRWMzAuOTc0em0yLjIyNSAxLjQ3NWg2LjY3MnYyLjIxMmgtNi42NzJ6bTAgNS4xNjJoNi42NzJ2Mi4yMTNoLTYuNjcyem0wIDUuMTYzaDYuNjcydjIuMjEyaC02LjY3MnptOS42MzgtMTAuMzI1aDYuNjcydjIuMjEyaC02LjY3MnptMCA1LjE2Mmg2LjY3MnYyLjIxM2gtNi42NzJ6bTAgNS4xNjNoNi42NzJ2Mi4yMTJoLTYuNjcyeiIvPjwvZz48L3N2Zz4="},"displayName":"Google Sheets","typeVersion":5,"nodeCategories":[{"id":3,"name":"Data & Storage"},{"id":4,"name":"Productivity"}]},{"id":112,"icon":"fa:map-signs","name":"n8n-nodes-base.switch","codex":{"data":{"alias":["Router","If","Path","Filter","Condition","Logic","Branch","Case"],"resources":{"generic":[{"url":"https://n8n.io/blog/2021-the-year-to-automate-the-new-you-with-n8n/","icon":"☀️","label":"2021: The Year to Automate the New You with n8n"},{"url":"https://n8n.io/blog/how-to-get-started-with-crm-automation-and-no-code-workflow-ideas/","icon":"👥","label":"How to get started with CRM automation (with 3 no-code workflow ideas"},{"url":"https://n8n.io/blog/build-your-own-virtual-assistant-with-n8n-a-step-by-step-guide/","icon":"👦","label":"Build your own virtual assistant with n8n: A step by step guide"},{"url":"https://n8n.io/blog/automation-for-maintainers-of-open-source-projects/","icon":"🏷️","label":"How to automatically manage contributions to open-source projects"}],"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.switch/"}]},"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Flow"]}}},"group":"[\"transform\"]","defaults":{"name":"Switch","color":"#506000"},"iconData":{"icon":"map-signs","type":"icon"},"displayName":"Switch","typeVersion":3,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":565,"icon":"fa:sticky-note","name":"n8n-nodes-base.stickyNote","codex":{"data":{"alias":["Comments","Notes","Sticky"],"categories":["Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers"]}}},"group":"[\"input\"]","defaults":{"name":"Sticky Note","color":"#FFD233"},"iconData":{"icon":"sticky-note","type":"icon"},"displayName":"Sticky Note","typeVersion":1,"nodeCategories":[{"id":9,"name":"Core Nodes"}]},{"id":834,"icon":"file:code.svg","name":"n8n-nodes-base.code","codex":{"data":{"alias":["cpde","Javascript","JS","Python","Script","Custom Code","Function"],"details":"The Code node allows you to execute JavaScript in your workflow.","resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.code/"}]},"categories":["Development","Core Nodes"],"nodeVersion":"1.0","codexVersion":"1.0","subcategories":{"Core Nodes":["Helpers","Data Transformation"]}}},"group":"[\"transform\"]","defaults":{"name":"Code"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTEyIiBoZWlnaHQ9IjUxMiIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF8xMTcxXzQ0MSkiPgo8cGF0aCBkPSJNMTcwLjI4MyA0OEgxOTYuNUMyMDMuMTI3IDQ4IDIwOC41IDQyLjYyNzQgMjA4LjUgMzZWMTJDMjA4LjUgNS4zNzI1OCAyMDMuMTI3IDAgMTk2LjUgMEgxNzAuMjgzQzEyNi4xIDAgOTAuMjgzIDM1LjgxNzIgOTAuMjgzIDgwVjE3NkM5MC4yODMgMjA2LjkyOCA2NS4yMTA5IDIzMiAzNC4yODMgMjMySDIzQzE2LjM3MjYgMjMyIDExIDIzNy4zNzIgMTEgMjQ0VjI2OEMxMSAyNzQuNjI3IDE2LjM3MjQgMjgwIDIyLjk5OTYgMjgwTDM0LjI4MyAyODBDNjUuMjEwOSAyODAgOTAuMjgzIDMwNS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A0MjIuOTc4IDQzMlYzMzZDNDIyLjk3OCAzMDUuMDcyIDQ0OC4wNTEgMjgwIDQ3OC45NzkgMjgwSDQ5MEM0OTYuNjI3IDI4MCA1MDIgMjc0LjYyOCA1MDIgMjY4VjI0NEM1MDIgMjM3LjM3MyA0OTYuNjI4IDIzMiA0OTAgMjMyTDQ3OC45NzkgMjMyQzQ0OC4wNTEgMjMyIDQyMi45NzggMjA2LjkyOCA0MjIuOTc4IDE3NlY4MEM0MjIuOTc4IDM1LjgxNzIgMzg3LjE2MSAwIDM0Mi45NzkgMEgzMTdDMzEwLjM3MyAwIDMwNSA1LjM3MjU4IDMwNSAxMlYzNloiIGZpbGw9IiNGRjk5MjIiLz4KPC9nPgo8ZGVmcz4KPGNsaXBQYXRoIGlkPSJjbGlwMF8xMTcxXzQ0MSI+CjxyZWN0IHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBmaWxsPSJ3aGl0ZSIvPgo8L2NsaXBQYXRoPgo8L2RlZnM+Cjwvc3ZnPgo="},"displayName":"Code","typeVersion":2,"nodeCategories":[{"id":5,"name":"Development"},{"id":9,"name":"Core Nodes"}]},{"id":1119,"icon":"fa:robot","name":"@n8n/n8n-nodes-langchain.agent","codex":{"data":{"alias":["LangChain","Chat","Conversational","Plan and Execute","ReAct","Tools"],"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Agents","Root Nodes"]}}},"group":"[\"transform\"]","defaults":{"name":"AI Agent","color":"#404040"},"iconData":{"icon":"robot","type":"icon"},"displayName":"AI Agent","typeVersion":3,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]},{"id":1153,"icon":"file:openAiLight.svg","name":"@n8n/n8n-nodes-langchain.lmChatOpenAi","codex":{"data":{"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatopenai/"}]},"categories":["AI","Langchain"],"subcategories":{"AI":["Language Models","Root Nodes"],"Language Models":["Chat Models (Recommended)"]}}},"group":"[\"transform\"]","defaults":{"name":"OpenAI Chat Model"},"iconData":{"type":"file","fileBuffer":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTM2Ljg2NzEgMTYuMzcxOEMzNy43NzQ2IDEzLjY0OCAzNy40NjIxIDEwLjY2NDIgMzYuMDEwOCA4LjE4NjYxQzMzLjgyODIgNC4zODY1MyAyOS40NDA3IDIuNDMxNDkgMjUuMTU1NiAzLjM1MTUxQzIzLjI0OTMgMS4yMDM5NiAyMC41MTA1IC0wLjAxNzMxNDggMTcuNjM5MiAwLjAwMDE4NTUzM0MxMy4yNTkxIC0wLjAwOTgxNDY4IDkuMzcyNzMgMi44MTAyNSA4LjAyNTIgNi45Nzc4M0M1LjIxMTM5IDcuNTU0MSAyLjc4MjU4IDkuMzE1MzggMS4zNjEzIDExLjgxMTdDLTAuODM3NDkzIDE1LjYwMTggLTAuMzM2MjMyIDIwLjM3OTQgMi42MDEzMyAyMy42Mjk0QzEuNjkzODEgMjYuMzUzMiAyLjAwNjMyIDI5LjMzNzEgMy40NTc2IDMxLjgxNDZDNS42NDAxNSAzNS42MTQ3IDEwLjAyNzcgMzcuNTY5NyAxNC4zMTI4IDM2LjY0OTdDMTYuMjE3OSAzOC43OTczIDE4Ljk1NzkgNDAuMDE4NSAyMS44MjkyIDM5Ljk5OThDMjYuMjExOCA0MC4wMTEgMzAuMDk5NCAzNy4xODg1IDMxLjQ0NjkgMzMuMDE3MUMzNC4yNjA4IDMyLjQ0MDkgMzYuNjg5NiAzMC42Nzk2IDM4LjExMDggMjguMTgzM0M0MC4zMDcxIDI0Lj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NaTTEzLjU3NDEgMjEuNDQzMUwxMC4yMDY1IDE5LjQ5OTRDMTAuMTcwMiAxOS40ODE5IDEwLjE0NjUgMTkuNDQ2OCAxMC4xNDE1IDE5LjQwNjhWMTAuMTA3OUMxMC4xNDQgNS45Njc4MSAxMy41MDI4IDIuNjEyNzQgMTcuNjQyOSAyLjYxNTI0QzE5LjM5NDIgMi42MTUyNCAyMS4wODkyIDMuMjMwMjUgMjIuNDM1NSA0LjM1MDI4QzIyLjM3NDMgNC4zODI3OCAyMi4yNjkzIDQuNDQxNTMgMjIuMTk5MiA0LjQ4NDAzTDE0LjIzNDEgOS4wODQxM0MxMy44MjY2IDkuMzE1MzggMTMuNTc2NiA5Ljc0Nzg5IDEzLjU3OTEgMTAuMjE2N0wxMy41NzQxIDIxLjQ0MDZWMjEuNDQzMVpNMTUuNDAyOSAxNy41MDA2TDE5LjczNDIgMTQuOTk5M0wyNC4wNjU1IDE3LjQ5OTNWMjIuNTAwN0wxOS43MzQyIDI1LjAwMDdMMTUuNDAyOSAyMi41MDA3VjE3LjUwMDZaIiBmaWxsPSIjN0Q3RDg3Ii8+Cjwvc3ZnPgo="},"displayName":"OpenAI Chat Model","typeVersion":1,"nodeCategories":[{"id":25,"name":"AI"},{"id":26,"name":"Langchain"}]}],"categories":[{"id":43,"name":"Personal Productivity"},{"id":47,"name":"AI Chatbot"}],"image":[]}}