Generación y publicación automáticas de encuestas de opción múltiple únicas en Telegram usando IA
Este es unContent Creation, Multimodal AIflujo de automatización del dominio deautomatización que contiene 15 nodos.Utiliza principalmente nodos como If, Aggregate, HttpRequest, GoogleSheets, Agent. Generar y publicar encuestas de opción múltiple únicas en Telegram con Gemini AI y Google Sheets
- •Pueden requerirse credenciales de autenticación para la API de destino
- •Credenciales de API de Google Sheets
- •Clave de API de Google Gemini
Nodos utilizados (15)
Categoría
{
"name": "Generate & Post Unique MCQ Polls to Telegram with AI",
"tags": [],
"nodes": [
{
"name": "Leer datos del cuestionario",
"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": "Leer-datos-del-cuestionario-0"
},
{
"name": "Enviar encuesta 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": "Enviar-encuesta-Telegram-1"
},
{
"name": "Actualizar estado del cuestionario 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": "Actualizar-estado-del-cuestionario-1-2"
},
{
"name": "Disparador de 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": "Disparador-de-Google-Sheets-3"
},
{
"name": "Agente de 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": "Agente-de-IA-4"
},
{
"name": "Modelo 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": "Modelo-de-chat-Google-Gemini-5"
},
{
"name": "Disparador programado",
"type": "n8n-nodes-base.scheduleTrigger",
"position": [
0,
0
],
"parameters": {
"rule": {
"interval": [
{
"field": "hours",
"hoursInterval": 3
}
]
}
},
"typeVersion": 1.2,
"id": "Disparador-programado-6"
},
{
"name": "Añadir o actualizar fila en hoja en 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": "A-adir-o-actualizar-fila-en-hoja-en-Google-Sheets1-7"
},
{
"name": "Memoria simple",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
288,
208
],
"parameters": {
"sessionKey": "={{ $execution.id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3,
"id": "Memoria-simple-8"
},
{
"name": "Obtener fila(s) en hoja en 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": "Obtener-fila-s-en-hoja-en-Google-Sheets-9"
},
{
"name": "Verificar nuevo cuestionario añadido",
"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": "Verificar-nuevo-cuestionario-a-adido-10"
},
{
"name": "Agregar",
"type": "n8n-nodes-base.aggregate",
"position": [
576,
592
],
"parameters": {
"options": {}
},
"typeVersion": 1,
"id": "Agregar-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": {
"Agente-de-IA-4": {
"main": [
[]
]
},
"Agregar-11": {
"main": [
[
{
"node": "Agente-de-IA-4",
"type": "main",
"index": 0
}
]
]
},
"Memoria-simple-8": {
"ai_memory": [
[
{
"node": "Agente-de-IA-4",
"type": "ai_memory",
"index": 0
}
]
]
},
"Leer-datos-del-cuestionario-0": {
"main": [
[
{
"node": "Verificar-nuevo-cuestionario-a-adido-10",
"type": "main",
"index": 0
}
]
]
},
"Disparador-programado-6": {
"main": [
[
{
"node": "Agente-de-IA-4",
"type": "main",
"index": 0
}
]
]
},
"Enviar-encuesta-Telegram-1": {
"main": [
[
{
"node": "Actualizar-estado-del-cuestionario-1-2",
"type": "main",
"index": 0
}
]
]
},
"Verificar-nuevo-cuestionario-a-adido-10": {
"main": [
[
{
"node": "Enviar-encuesta-Telegram-1",
"type": "main",
"index": 0
}
],
[
{
"node": "Agregar-11",
"type": "main",
"index": 0
}
]
]
},
"Disparador-de-Google-Sheets-3": {
"main": [
[
{
"node": "Leer-datos-del-cuestionario-0",
"type": "main",
"index": 0
}
]
]
},
"Modelo-de-chat-Google-Gemini-5": {
"ai_languageModel": [
[
{
"node": "Agente-de-IA-4",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Obtener-fila-s-en-hoja-en-Google-Sheets-9": {
"ai_tool": [
[
{
"node": "Agente-de-IA-4",
"type": "ai_tool",
"index": 0
}
]
]
},
"A-adir-o-actualizar-fila-en-hoja-en-Google-Sheets1-7": {
"ai_tool": [
[
{
"node": "Agente-de-IA-4",
"type": "ai_tool",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Intermedio - Creación de contenido, IA Multimodal
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
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.
Compartir este flujo de trabajo