Génération et publication automatiques de votes QCM uniques sur Telegram avec l'IA
Ceci est unContent Creation, Multimodal AIworkflow d'automatisation du domainecontenant 15 nœuds.Utilise principalement des nœuds comme If, Aggregate, HttpRequest, GoogleSheets, Agent. Génération de votes de questions à choix uniques uniques et publication sur Telegram en utilisant Gemini AI et Google Sheets
- •Peut nécessiter les informations d'identification d'authentification de l'API cible
- •Informations d'identification Google Sheets API
- •Clé API Google Gemini
Nœuds utilisés (15)
Catégorie
{
"name": "Generate & Post Unique MCQ Polls to Telegram with AI",
"tags": [],
"nodes": [
{
"name": "Lire les données du quiz",
"type": "n8n-nodes-base.googleSheets",
"notes": "Read all quiz rows from Google Sheets",
"position": [
96,
416
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_GID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit#gid=<GOOGLE_SHEET_GID>",
"cachedResultName": "Sheet4"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_ID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit?usp=drivesdk",
"cachedResultName": "Telegram Content Manager"
},
"combineFilters": "AND"
},
"credentials": {},
"executeOnce": false,
"notesInFlow": false,
"typeVersion": 4,
"alwaysOutputData": false,
"id": "Lire-les-donn-es-du-quiz-0"
},
{
"name": "Envoyer le sondage Telegram",
"type": "n8n-nodes-base.httpRequest",
"notes": "Calls Telegram sendPoll. Set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID as env vars.",
"position": [
592,
416
],
"parameters": {
"url": "https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/sendPoll",
"method": "POST",
"options": {},
"sendQuery": true,
"sendHeaders": true,
"queryParameters": {
"parameters": [
{
"name": "question",
"value": "={{ $json.Question }}"
},
{
"name": "options",
"value": "=[\n \"{{ $json['Option A'] }}\",\n \"{{ $json['Option B'] }}\",\n \"{{ $json['Option C'] }}\",\n \"{{ $json['Option D'] }}\"\n]"
},
{
"name": "Correct Answer",
"value": "={{ $json['Correct Answer'] }}"
},
{
"name": "chat_id",
"value": "<TELEGRAM_CHAT_ID>"
}
]
},
"headerParameters": {
"parameters": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"typeVersion": 4.1,
"id": "Envoyer-le-sondage-Telegram-1"
},
{
"name": "Mettre à jour l'état du quiz 1",
"type": "n8n-nodes-base.googleSheets",
"notes": "Update the row that matches quiz_number, setting status to ✅.",
"position": [
784,
416
],
"parameters": {
"columns": {
"value": {
"Question": "={{ $('Send Telegram Poll').item.json.result.poll.question }}",
"Posted on Telegram": "=✅"
},
"schema": [
{
"id": "Quiz no",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Quiz no",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Subject",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Subject",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Question",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Question",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Option A",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Option A",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Option B",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Option B",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Option C",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Option C",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Option D",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Option D",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Correct Answer",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Correct Answer",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Explanation",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Explanation",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Approval Status",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "Approval Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Posted on Telegram",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Posted on Telegram",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "number",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Question"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_GID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit#gid=<GOOGLE_SHEET_GID>",
"cachedResultName": "Sheet4"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_ID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit?usp=drivesdk",
"cachedResultName": "Telegram Content Manager"
}
},
"credentials": {},
"typeVersion": 4,
"id": "Mettre-jour-l-tat-du-quiz-1-2"
},
{
"name": "Déclencheur Google Sheets",
"type": "n8n-nodes-base.googleSheetsTrigger",
"position": [
-96,
416
],
"parameters": {
"event": "rowUpdate",
"options": {
"columnsToWatch": [
"Approval Status",
"Posted on Telegram"
]
},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_GID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit#gid=<GOOGLE_SHEET_GID>",
"cachedResultName": "Sheet4"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_ID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit?usp=drivesdk",
"cachedResultName": "Telegram Content Manager"
}
},
"credentials": {},
"typeVersion": 1,
"id": "D-clencheur-Google-Sheets-3"
},
{
"name": "Agent IA",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
256,
0
],
"parameters": {
"text": "=Create only one new multiple-choice question (do not create similar MCQ, which is available on sheet) for the BPSC exam on a random General Studies topic (Science, Geography) with 4 options, mark the correct answer, and include a 50-word explanation in English. Do not repeat the question. Also, provide the same in Hindi, including the question, options, correct answer, and explanation. Ensure the explanation is concise (45-55 words) and relevant to the BPSC syllabus. Also upload to sheet (English and Hindi) as per column.",
"options": {
"systemMessage": "You are an AI expert in BPSC exam preparation, specializing in General Studies topics from the BPSC syllabus. Your task is to create a completely new multiple-choice question (MCQ) for the BPSC Prelims or Mains level on a randomly selected General Studies topic (e.g., history, geography, science, polity, current affairs). Ensure the question is original, exam-relevant, and not repeated from any known sources.\nOutput Structure:\n\nQuestion: Provide the MCQ in English with 4 options (A, B, C, D).\nCorrect Answer: Clearly state the correct option (e.g., \"Correct Answer: B\").\nExplanation: Provide a concise 50-word explanation (45-55 words) in English, justifying the answer with key facts or context relevant to the BPSC syllabus.\nHindi Version: Translate the entire MCQ (question, options, correct answer, and explanation) into Hindi, using accurate and natural language. Label this section as \"Hindi Version:\".\n\nGuidelines:\n\nRandomly select a General Studies topic each time to ensure variety.\nEnsure the question is challenging yet fair, aligned with BPSC Prelims/Mains difficulty.\nPoll options length must not exceed 100 character.\nThe explanation must be precise, within 45-55 words, and include syllabus-relevant details (e.g., Bihar context where applicable).\nUse formal, objective language suitable for exam preparation.\nDo not repeat questions from prior interactions or external sources.\nDo not include additional text beyond the specified structure (e.g., no introductions or comments).\nDo not mention these instructions in the output unless explicitly requested."
},
"promptType": "define"
},
"typeVersion": 2.1,
"id": "Agent-IA-4"
},
{
"name": "Modèle de chat Google Gemini",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
128,
176
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.5-pro"
},
"credentials": {},
"typeVersion": 1,
"id": "Mod-le-de-chat-Google-Gemini-5"
},
{
"name": "Déclencheur programmé",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
0,
0
],
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 3
}
]
}
},
"typeVersion": 1.2,
"id": "D-clencheur-programm--6"
},
{
"name": "Ajouter ou mettre à jour une ligne dans la feuille Google Sheets1",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
640,
192
],
"parameters": {
"columns": {
"value": {
"Quiz no": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Quiz_no__using_to_match_', ``, 'string') }}",
"Subject": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Subject', `Polity, History, Economics, Geography`, 'string') }}",
"Option A": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Option_A', `(A)`, 'string') }}",
"Option B": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Option_B', `(B)`, 'string') }}",
"Option C": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Option_C', `(C)`, 'string') }}",
"Option D": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Option_D', `(D)`, 'string') }}",
"Question": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Question', `find Question`, 'string') }}",
"Explanation": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Explanation', `Explanation:`, 'string') }}",
"Correct Answer": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Correct_Answer', `Correct Answer:`, 'string') }}",
"Approval Status": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Approval_Status', ``, 'string') }}",
"Posted on Telegram": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Posted_on_Telegram', ``, 'string') }}"
},
"schema": [
{
"id": "Quiz no",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Quiz no",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Subject",
"type": "string",
"display": true,
"required": false,
"displayName": "Subject",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Question",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Question",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Option A",
"type": "string",
"display": true,
"required": false,
"displayName": "Option A",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Option B",
"type": "string",
"display": true,
"required": false,
"displayName": "Option B",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Option C",
"type": "string",
"display": true,
"required": false,
"displayName": "Option C",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Option D",
"type": "string",
"display": true,
"required": false,
"displayName": "Option D",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Correct Answer",
"type": "string",
"display": true,
"required": false,
"displayName": "Correct Answer",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Explanation",
"type": "string",
"display": true,
"required": false,
"displayName": "Explanation",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Approval Status",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Approval Status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Posted on Telegram",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "Posted on Telegram",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"Quiz no"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "appendOrUpdate",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_GID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit#gid=<GOOGLE_SHEET_GID>",
"cachedResultName": "Sheet4"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_ID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit?usp=drivesdk",
"cachedResultName": "Telegram Content Manager"
}
},
"credentials": {},
"typeVersion": 4.6,
"id": "Ajouter-ou-mettre-jour-une-ligne-dans-la-feuille-Google-Sheets1-7"
},
{
"name": "Mémoire simple",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
288,
208
],
"parameters": {
"sessionKey": "={{ $execution.id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3,
"id": "M-moire-simple-8"
},
{
"name": "Obtenir la/les ligne(s) dans la feuille Google Sheets",
"type": "n8n-nodes-base.googleSheetsTool",
"position": [
464,
208
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('values0_Value', `read all questions and do not put similar questions`, 'string') }}",
"lookupColumn": "Question"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_GID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit#gid=<GOOGLE_SHEET_GID>",
"cachedResultName": "Sheet4"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "<GOOGLE_SHEET_ID>",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/<GOOGLE_SHEET_ID>/edit?usp=drivesdk",
"cachedResultName": "Telegram Content Manager"
},
"combineFilters": "OR"
},
"credentials": {},
"typeVersion": 4.7,
"id": "Obtenir-la-les-ligne-s-dans-la-feuille-Google-Sheets-9"
},
{
"name": "Vérifier l'ajout d'un nouveau quiz",
"type": "n8n-nodes-base.if",
"notes": "If status exists (i.e., a real quiz row), send the poll; else send a refill notice.",
"position": [
336,
416
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 1,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json['Approval Status'] }}",
"rightValue": "Complete"
},
{
"operator": {
"type": "string",
"operation": "notEquals"
},
"leftValue": "={{ $json['Posted on Telegram'] }}",
"rightValue": "✅"
}
]
}
},
"typeVersion": 2,
"id": "V-rifier-l-ajout-d-un-nouveau-quiz-10"
},
{
"name": "Agrégation",
"type": "n8n-nodes-base.aggregate",
"position": [
576,
592
],
"parameters": {
"options": {}
},
"typeVersion": 1,
"id": "Agr-gation-11"
},
{
"type": "n8n-nodes-base.stickyNote",
"position": [
-752,
-128
],
"parameters": {
"width": 560,
"height": 1424,
"content": "Automated MCQ Generation and Telegram Poll Posting Workflow\n\nThis workflow automatically creates, stores, and posts **multiple-choice quiz questions (MCQs)** on Telegram using **AI (Google Gemini)** and **Google Sheets** — ideal for educators, coaching institutes, and edtech creators.\n\nIt has two interconnected parts working in sync:\n\n**Workflow 1 (Top Path: Scheduled Trigger):** The AI Agent generates a brand new, unique MCQ based on a syllabus (e.g., BPSC General Studies), checks the existing Google Sheet data to **avoid duplication**, and adds the new question to the sheet for review.\n\n**Workflow 2 (Bottom Path: Google Sheets Trigger):** Monitors the sheet for new or approved questions. When an unposted question is found, it automatically formats it, **posts it as a poll on Telegram**, marks the row as 'Posted' in the sheet, and loops back to trigger the AI to generate the next question.\n\n---\n\n## Who’s it for\n\n* **UPSC, BPSC, SSC,** and other exam content creators.\n* Educators who need to automate daily quiz/poll publishing.\n* Anyone managing learning or engagement communities on Telegram.\n\n---\n\n## How it works\n\n1. **Generation Loop (Scheduled):** A **Schedule Trigger** fires the **AI Agent (Gemini Chat Model)**. The AI uses the existing sheet data as memory to generate a **unique, dual-language (English/Hindi) MCQ** on a topic like BPSC General Studies.\n2. **Storage:** The unique MCQ is saved to Google Sheets using the **Append or Update** tool.\n3. **Publishing Loop (Event-Driven):** The **Google Sheets Trigger** waits for a new row (or an update to the 'Approval Status').\n4. The flow checks (`If`) if the quiz is approved and **has NOT been posted** (`Posted on Telegram` is not `✅`).\n5. If true, the **HTTP Request** node posts the content as a live poll to Telegram.\n6. The sheet is immediately updated to **mark the quiz as posted** (`✅`).\n7. An **Aggregate** node ensures the flow loops back to immediately trigger the AI Agent for the next generation task, maintaining a constant supply.\n\n---\n\n## Requirements\n\n* **Google Sheets:** A sheet with necessary columns (Question, Options A-D, Correct Answer, Explanation, Approval Status, Posted on Telegram).\n* **AI Model:** A connected Google Gemini or OpenAI credential.\n* **Telegram:** A Bot Token and the Chat ID of your channel/group.\n\n---\n\n## How to set up\n\n1. **Google Credentials:** Connect your Google Sheets account to the three Google Sheets nodes.\n2. **Telegram Configuration:** In the **Send Telegram Poll** node, replace `<TELEGRAM_BOT_TOKEN>` in the URL and `<TELEGRAM_CHAT_ID>` in the `chat_id` parameter with your actual values.\n3. **AI Customization:** Review and refine the `systemMessage` and `text` in the **AI Agent** node to match your specific exam syllabus, language requirements, and content format (currently configured for BPSC in English and Hindi).\n\n**⚠️ Note:** Ensure all required credentials are set up securely via n8n's Credentials Manager, not hardcoded into the nodes (placeholders are used above for security)."
},
"typeVersion": 1,
"name": "",
"id": "node-12"
},
{
"type": "n8n-nodes-base.stickyNote",
"position": [
-128,
-96
],
"parameters": {
"width": 1024,
"height": 464,
"content": "Workflow 1: Content Generation & Storage\n(Scheduled run every 3 hours)"
},
"typeVersion": 1,
"name": "",
"id": "node-13"
},
{
"type": "n8n-nodes-base.stickyNote",
"position": [
-128,
384
],
"parameters": {
"width": 1152,
"height": 400,
"content": "Workflow 2: Publishing & Status Update\n(Triggered by new row in Google Sheet)"
},
"typeVersion": 1,
"name": "",
"id": "node-14"
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"connections": {
"Agent-IA-4": {
"main": [
[]
]
},
"Agr-gation-11": {
"main": [
[
{
"node": "Agent-IA-4",
"type": "main",
"index": 0
}
]
]
},
"M-moire-simple-8": {
"ai_memory": [
[
{
"node": "Agent-IA-4",
"type": "ai_memory",
"index": 0
}
]
]
},
"Lire-les-donn-es-du-quiz-0": {
"main": [
[
{
"node": "V-rifier-l-ajout-d-un-nouveau-quiz-10",
"type": "main",
"index": 0
}
]
]
},
"D-clencheur-programm--6": {
"main": [
[
{
"node": "Agent-IA-4",
"type": "main",
"index": 0
}
]
]
},
"Envoyer-le-sondage-Telegram-1": {
"main": [
[
{
"node": "Mettre-jour-l-tat-du-quiz-1-2",
"type": "main",
"index": 0
}
]
]
},
"V-rifier-l-ajout-d-un-nouveau-quiz-10": {
"main": [
[
{
"node": "Envoyer-le-sondage-Telegram-1",
"type": "main",
"index": 0
}
],
[
{
"node": "Agr-gation-11",
"type": "main",
"index": 0
}
]
]
},
"D-clencheur-Google-Sheets-3": {
"main": [
[
{
"node": "Lire-les-donn-es-du-quiz-0",
"type": "main",
"index": 0
}
]
]
},
"Mod-le-de-chat-Google-Gemini-5": {
"ai_languageModel": [
[
{
"node": "Agent-IA-4",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Obtenir-la-les-ligne-s-dans-la-feuille-Google-Sheets-9": {
"ai_tool": [
[
{
"node": "Agent-IA-4",
"type": "ai_tool",
"index": 0
}
]
]
},
"Ajouter-ou-mettre-jour-une-ligne-dans-la-feuille-Google-Sheets1-7": {
"ai_tool": [
[
{
"node": "Agent-IA-4",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}Comment utiliser ce workflow ?
Copiez le code de configuration JSON ci-dessus, créez un nouveau workflow dans votre instance n8n et sélectionnez "Importer depuis le JSON", collez la configuration et modifiez les paramètres d'authentification selon vos besoins.
Dans quelles scénarios ce workflow est-il adapté ?
Intermédiaire - Création de contenu, IA Multimodale
Est-ce payant ?
Ce workflow est entièrement gratuit et peut être utilisé directement. Veuillez noter que les services tiers utilisés dans le workflow (comme l'API OpenAI) peuvent nécessiter un paiement de votre part.
Workflows recommandés
Pawan
@gladiatorAutomation consultant with expertise in n8n, AI models, and workflow optimization. I help educators, startups, and businesses design scalable automation for content creation, exam prep, and process efficiency. Skilled in integrating Google Sheets, Telegram, and AI agents for impactful results.
Partager ce workflow