Asistente de investigación profunda con referencias de Perplexity AI y Telegram
Este es unAI Chatbot, Multimodal AIflujo de automatización del dominio deautomatización que contiene 16 nodos.Utiliza principalmente nodos como Filter, Telegram, PerplexityTool, Agent, TelegramTrigger. Asistente de investigación profunda con Perplexity AI y citas de Telegram
- •Bot Token de Telegram
- •Clave de API de OpenAI
Nodos utilizados (16)
Categoría
{
"meta": {
"instanceId": "93492ad7b85fe52ec3ead1e96f0add030f2389fbe9175f2fc6dc08fb0457b641",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "c75d8927-6322-4d3e-a2a0-21e719ffc63e",
"name": "Agente de IA",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-384,
-224
],
"parameters": {
"text": "={{ $json.chatInput }} {{ $json.message.text }}",
"options": {
"systemMessage": "=You are a research-focused AI assistant that combines real-time web intelligence from Perplexity to generate insightful, concise, and well-cited answers to my queries.\n\n🔧 Tool Usage Logic\n\nUse the Perplexity Sonar tool for:\n\t•\tQuick lookups and factual summaries\n\t•\tDefinitions, current events, book/show/movie synopses\n\t•\tExplainers for theories, concepts, and popular discussions\n\t•\tPodcast and video summaries\n\t•\tTrend monitoring and fast comparisons\n\nUse the Perplexity Sonar Pro tool for:\n\t•\tQuestions requiring synthesis of multiple sources or expert reasoning\n\t•\tBusiness research (competitor analysis, investor briefs, product comparisons)\n\t•\tScientific or academic deep-dives\n\t•\tStructured summarization (transcripts, feedback, legal docs, surveys)\n\t•\tMarket trend analysis, job monitoring, and sentiment clustering\n\t•\tLong-form content aggregation across industries, geographies, or verticals\n\n🧠 Output Guidelines\n\t•\tFocus only on answering the user’s question. Do not offer extra services unless explicitly requested.\n\t•\tDeliver answers in clear, structured formats\n\t•\tInclude citations with clickable URLs from the original sources used by Perplexity. \n\t•\tIf the query contains ambiguity, politely ask for clarification instead of guessing.\n\n📌 Style & Tone\n\t•\tMaintain a professional, neutral tone.\n\t•\tUse plain language for general audiences unless the context requires technical specificity.\n\t•\tPrioritize depth, clarity, and relevance over length.\n\t•\tAvoid filler language and generic intros—get straight to the value.\n\nIf I ask about a person, use Sonar Pro and in addition to all details, get links to their social profiles: Instagram, LinkedIn, and whichever others you can find."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "0df084d7-379c-4a44-96c6-9faf75168485",
"name": "Modelo de Chat OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-720,
64
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini",
"cachedResultName": "gpt-4o-mini"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "GHCe1xYUWsC8pVC6",
"name": "OpenAi account 2"
}
},
"typeVersion": 1.2
},
{
"id": "00b2cd49-ab28-4148-9b5a-f11345b90e65",
"name": "Memoria de Búfer de Ventana",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
-416,
48
],
"parameters": {
"sessionKey": "={{ $json.message.chat.id }}",
"sessionIdType": "customKey"
},
"typeVersion": 1.3
},
{
"id": "b7b7feb3-0eaf-4607-86cd-46ec16f57258",
"name": "Perplexity Sonar",
"type": "n8n-nodes-base.perplexityTool",
"position": [
-80,
48
],
"parameters": {
"model": "sonar",
"options": {},
"messages": {
"message": [
{}
]
},
"requestOptions": {}
},
"credentials": {
"perplexityApi": {
"id": "iVyxXY6X3aKOLsni",
"name": "Perplexity account 2"
}
},
"typeVersion": 1
},
{
"id": "b88c3c4c-fc80-4f4e-baf5-2a92cafd49cb",
"name": "Perplexity Sonar Pro",
"type": "n8n-nodes-base.perplexityTool",
"position": [
128,
48
],
"parameters": {
"model": "sonar-pro",
"options": {},
"messages": {
"message": [
{}
]
},
"requestOptions": {}
},
"credentials": {
"perplexityApi": {
"id": "iVyxXY6X3aKOLsni",
"name": "Perplexity account 2"
}
},
"typeVersion": 1
},
{
"id": "7cb5983f-c2a1-4401-9fd2-ec045c718247",
"name": "Activador Telegram",
"type": "n8n-nodes-base.telegramTrigger",
"position": [
-992,
-224
],
"webhookId": "d7061cf0-267b-4818-883f-42972ea7672f",
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"typeVersion": 1.1
},
{
"id": "bb263737-5be3-4807-9da3-db4e31fc1cf8",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"position": [
-16,
-224
],
"webhookId": "e38f4bdb-0f47-45b0-a258-20cb49c3b4f4",
"parameters": {
"text": "={{ $json.output }}",
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"additionalFields": {}
},
"typeVersion": 1.2
},
{
"id": "f8da851b-40f5-4bad-a6d2-fa0488c59112",
"name": "Filtro",
"type": "n8n-nodes-base.filter",
"position": [
-672,
-224
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "be4dd9dc-55f3-4668-a5e8-0205c230fb75",
"operator": {
"type": "number",
"operation": "equals"
},
"leftValue": "={{ $json.message.from.id }}",
"rightValue": 5675741296
}
]
}
},
"typeVersion": 2.2
},
{
"id": "e298f904-ec98-4cc7-b599-66b044a280a2",
"name": "Descripción General del Flujo de Trabajo",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1504,
-416
],
"parameters": {
"color": 4,
"width": 350,
"height": 356,
"content": "📋 WORKFLOW OVERVIEW\n\n🔄 FLOW:\nTelegram → Filter → AI Agent → Response\n\n🔧 REQUIRED SETUP:\n1. Telegram Bot Token\n2. OpenAI API Key\n3. Perplexity API Key\n4. Update user ID in filter\n\n⚠️ SECURITY:\n- Keep API keys secure\n- User filter prevents unauthorized access\n- Test with your user ID first"
},
"typeVersion": 1
},
{
"id": "038365a8-bb63-4534-8dc9-6acef4f33682",
"name": "Configuración de Telegram",
"type": "n8n-nodes-base.stickyNote",
"position": [
-1088,
-464
],
"parameters": {
"width": 300,
"height": 406,
"content": "📱 TELEGRAM TRIGGER SETUP\n\n1. Create a Telegram bot via @BotFather\n2. Get your bot token\n3. Add Telegram credentials in n8n\n4. Set webhook URL in bot settings\n\n⚠️ IMPORTANT: Update the webhook ID if importing this workflow"
},
"typeVersion": 1
},
{
"id": "e5778cb2-410b-42f8-9516-5b75e70a0dab",
"name": "Filtro de Seguridad",
"type": "n8n-nodes-base.stickyNote",
"position": [
-752,
-544
],
"parameters": {
"color": 2,
"width": 280,
"height": 460,
"content": "🔒 USER FILTER\n\n⚠️ CHANGE REQUIRED:\nUpdate the user ID (5675741296) to your Telegram user ID\n\nTo find your ID:\n1. Message @userinfobot on Telegram\n2. Replace the number in the filter condition\n\nThis prevents unauthorized access to your bot"
},
"typeVersion": 1
},
{
"id": "1aa1f2e7-69ab-467d-9445-5c822e250d17",
"name": "Configuración del Agente de IA",
"type": "n8n-nodes-base.stickyNote",
"position": [
-432,
-624
],
"parameters": {
"color": 6,
"width": 320,
"height": 528,
"content": "🤖 AI AGENT CORE\n\n⚙️ CUSTOMIZATION OPTIONS:\n\n1. SYSTEM MESSAGE:\n - Modify research focus\n - Change response style\n - Adjust tool usage logic\n\n2. PROMPT HANDLING:\n - Currently uses chat input + message text\n - Can modify input processing\n\n3. BEHAVIOR:\n - Update guidelines for different use cases\n - Modify citation requirements"
},
"typeVersion": 1
},
{
"id": "261f40c0-6f40-492a-a455-f032331d0e4e",
"name": "Respuesta de Telegram",
"type": "n8n-nodes-base.stickyNote",
"position": [
-96,
-528
],
"parameters": {
"width": 280,
"height": 444,
"content": "📤 TELEGRAM RESPONSE\n\nSends AI response back to user\n\n⚙️ CUSTOMIZATION:\n- Add message formatting\n- Include parse_mode for HTML/Markdown\n- Add reply_to_message_id for threading\n- Modify response structure\n\n💡 Uses same Telegram credentials as trigger"
},
"typeVersion": 1
},
{
"id": "11bbb9dc-ebf2-4ec1-9a9d-00e366c21d30",
"name": "Configuración de OpenAI",
"type": "n8n-nodes-base.stickyNote",
"position": [
-816,
16
],
"parameters": {
"color": 5,
"width": 280,
"height": 470,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n🤖 OPENAI SETUP\n\n1. Get API key from OpenAI platform\n2. Add OpenAI credentials in n8n\n3. Select your preferred model\n\n💡 TIP: gpt-4o-mini is cost-effective\n\n⚙️ CUSTOMIZATION:\n- Change model based on your needs\n- Adjust temperature in options if needed"
},
"typeVersion": 1
},
{
"id": "5ee33d92-73d4-410d-bbfd-046633442917",
"name": "Configuración de Memoria",
"type": "n8n-nodes-base.stickyNote",
"position": [
-512,
16
],
"parameters": {
"color": 7,
"width": 260,
"height": 466,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n🧠 MEMORY CONFIGURATION\n\nCurrently uses chat ID for session management\n\n⚙️ CUSTOMIZATION OPTIONS:\n- Change session key logic\n- Adjust window size for memory\n- Modify memory type if needed\n\nThis maintains conversation context per chat"
},
"typeVersion": 1
},
{
"id": "fcf87cde-7a38-4683-9b1a-976103daf0c9",
"name": "Perplexity Pro",
"type": "n8n-nodes-base.stickyNote",
"position": [
-240,
16
],
"parameters": {
"color": 3,
"width": 636,
"height": 998,
"content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n🔍 PERPLEXITY SONAR\n\n1. Get API key from Perplexity\n2. Add HTTP Header Auth credentials\n3. Set Authorization: Bearer YOUR_API_KEY\n\n⚙️ CUSTOMIZATION:\n- Adjust max_tokens (currently 200)\n- Modify model if Perplexity updates\n- Change tool description for different use cases\n\nPerplexity Sonar (\"Sonar\" model):\n\n- Designed for quick lookups and factual summaries\n- Best for definitions, current events, book/show/movie synopses\n- Handles explainers for theories, concepts, and popular discussions\n- Good for podcast and video summaries\n- Efficient for trend monitoring and fast comparisons\n\n\n\nPerplexity Sonar Pro (\"Sonar Pro\" model):\n\n- Built for questions requiring synthesis of multiple sources or expert reasoning\n- Excels at business research (competitor analysis, investor briefs, product comparisons)\n- Handles scientific or academic deep-dives\n- Perfect for structured summarization (transcripts, feedback, legal docs, surveys)\n- Specialized in market trend analysis, job monitoring, and sentiment clustering\n- Manages long-form content aggregation across industries, geographies, or verticals\n\n\n\nThe AI Agent's system message specifically instructs it to choose the appropriate tool based on the complexity and type of research needed. This creates an intelligent routing system where simpler queries use the faster, more cost-effective Sonar model, while complex research tasks leverage the more powerful Sonar Pro model.\n\nYou can adjust the AI's prmopt to just use 1 or the other and disable or delete the unused node."
},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"f8da851b-40f5-4bad-a6d2-fa0488c59112": {
"main": [
[
{
"node": "c75d8927-6322-4d3e-a2a0-21e719ffc63e",
"type": "main",
"index": 0
}
]
]
},
"c75d8927-6322-4d3e-a2a0-21e719ffc63e": {
"main": [
[
{
"node": "bb263737-5be3-4807-9da3-db4e31fc1cf8",
"type": "main",
"index": 0
}
]
]
},
"b7b7feb3-0eaf-4607-86cd-46ec16f57258": {
"ai_tool": [
[
{
"node": "c75d8927-6322-4d3e-a2a0-21e719ffc63e",
"type": "ai_tool",
"index": 0
}
]
]
},
"7cb5983f-c2a1-4401-9fd2-ec045c718247": {
"main": [
[
{
"node": "f8da851b-40f5-4bad-a6d2-fa0488c59112",
"type": "main",
"index": 0
}
]
]
},
"0df084d7-379c-4a44-96c6-9faf75168485": {
"ai_languageModel": [
[
{
"node": "c75d8927-6322-4d3e-a2a0-21e719ffc63e",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"b88c3c4c-fc80-4f4e-baf5-2a92cafd49cb": {
"ai_tool": [
[
{
"node": "c75d8927-6322-4d3e-a2a0-21e719ffc63e",
"type": "ai_tool",
"index": 0
}
]
]
},
"00b2cd49-ab28-4148-9b5a-f11345b90e65": {
"ai_memory": [
[
{
"node": "c75d8927-6322-4d3e-a2a0-21e719ffc63e",
"type": "ai_memory",
"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?
Avanzado - Chatbot de IA, 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
David
@davidsCompartir este flujo de trabajo