Automatiza la publicación de actualizaciones del changelog de n8n en un canal de Telegram, aprovechando la IA para traducir, optimizar y personalizar el contenido extraído del feed RSS oficial, asegurando mensajes claros y atractivos.
Creado: 2024-12-04
6 nodos
Instrucciones
Editar Workflow
Visualización del Workflow
{
"name": "Changelog N8N",
"nodes": [
{
"parameters": {
"functionCode": "return items.map(item => {\n const { title, link, pubDate, content } = item.json;\n\n // Funci\u00f3n para extraer una secci\u00f3n del contenido HTML\n function extractSection(content, sectionTitle) {\n const regex = new RegExp(`(.*?)<\\/strong>:/g, \"\u2022 *$1*:\") // Negrita para las categor\u00edas\n .replace(/<\\/?[^>]+(>|$)/g, \"\") // Eliminar etiquetas HTML\n .trim();\n return rawItems.split(\"\\n\").slice(0, 5).join(\"\\n\"); // Limitar a 5 elementos\n }\n\n // Extraer las secciones relevantes\n const bugFixes = extractSection(content, \"Bug Fixes\") || \"No se especificaron cambios.\";\n const features = extractSection(content, \"Features\") || \"No se especificaron nuevas funcionalidades.\";\n const improvements = extractSection(content, \"Performance Improvements\") || \"No se especificaron mejoras de rendimiento.\";\n\n // Formatear la fecha\n const formattedDate = new Date(pubDate).toLocaleDateString('es-ES', {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n });\n\n // Crear el mensaje final\n const message = `\n\ud83d\udce2 *${title}*\n\ud83d\uddd3\ufe0f _Fecha de publicaci\u00f3n:_ ${formattedDate}\n\n\ud83d\udcdd _Resumen de cambios:_\n\n\ud83d\udd27 *Correcciones de errores:*\n${bugFixes}\n\n\u2728 *Nuevas funcionalidades:*\n${features}\n\n\ud83d\ude80 *Mejoras de rendimiento:*\n${improvements}\n `.trim();\n\n return {\n json: {\n message, // Mensaje formateado para Telegram\n link, // Link separado\n },\n };\n});\n"
},
"name": "Filter by name",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
-840,
-140
],
"id": "cc244e9f-00c1-4e66-a3dd-32f8275e9414"
},
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"feedUrl": "https://github.com/n8n-io/n8n/releases.atom"
},
"type": "n8n-nodes-base.rssFeedReadTrigger",
"typeVersion": 1,
"position": [
-1060,
-140
],
"id": "ce672bf6-539d-441a-9db8-240323254f47",
"name": "RSS Feed Trigger"
},
{
"parameters": {
"promptType": "define",
"text": "=message: {{ $json.message }}\n\nlink: {{ $json.link }}",
"hasOutputParser": true,
"messages": {
"messageValues": [
{
"message": "Genera un JSON en Espa\u00f1ol que contenga:\n1. Un campo `message` con el contenido en HTML, compatible con Telegram, incluyendo saltos de l\u00ednea `\\n` para separar secciones.\n2. En el campo `message`no debe aparecer Ver detalles con el enlace o el enlace\n3. Un campo `url` con un enlace externo relacionado.\n\nEl JSON debe seguir este formato:\n{\n \"message\": \"\",\n \"url\": \"\"\n}\n\nEjemplo:\n\n{\n \"message\": \"\ud83d\udce2 n8n@1.71.0\\n\ud83d\uddd3\ufe0f Fecha de publicaci\u00f3n: 4 de diciembre de 2024\\n\\n\ud83d\udcdd Resumen de cambios:\\n\\n\ud83d\udd27 Correcciones de errores:\\n\\n\u2022 core: Fix push for waiting executions (#11984)\\n\u2022 core: Improve header parameter parsing on http client responses (#11953)\\n\u2022 core: Opt-out from optimizations if $item is used (#12036)\\n\u2022 core: Use the configured timezone in task runner (#12032)\\n\u2022 core: Validate node name when creating NodeOperationErrror (#11999)\\n\\n\u2728 Nuevas funcionalidades:\\n\\n\u2022 AI Transform Node: Node Prompt improvements (#11611)\\n\u2022 Code Node: Warning if pairedItem absent or could not be auto mapped (#11737)\\n\u2022 editor: Canvas chat UI & UX improvements (#11924)\\n\u2022 editor: Persist user's preferred display modes on localStorage (#11929)\\n\\n\ud83d\ude80 Mejoras de rendimiento:\\n\\n\u2022 editor: Virtualize SchemaView (#11694)\",\n \"link\": \"https://github.com/n8n-io/n8n/releases/tag/n8n%401.71.0\"\n}\n\n\n\n\n\n"
}
]
}
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.5,
"position": [
-620,
-140
],
"id": "1eee1e1a-5535-4fd6-9553-9e48d7b53430",
"name": "Basic LLM Chain"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1,
"position": [
-580,
60
],
"id": "52aea551-0198-4179-bdca-5f6e532aced1",
"name": "OpenAI Chat Model",
"credentials": {
"openAiApi": {
"id": "U2xZhcMkJPzRaFD7",
"name": "Nueva"
}
}
},
{
"parameters": {
"jsonSchemaExample": "{\n\t\"mensaje\": \"Mensaje en html listo para telegram\",\n\t\"link\": \"enlace\"\n}"
},
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"typeVersion": 1.2,
"position": [
-400,
60
],
"id": "200b094d-712b-4fc5-9060-9e47d16a1e42",
"name": "Structured Output Parser"
},
{
"parameters": {
"chatId": "@comunidadn8n",
"text": "={{ $json.output.mensaje }}",
"replyMarkup": "inlineKeyboard",
"inlineKeyboard": {
"rows": [
{
"row": {
"buttons": [
{
"text": "\ud83d\uddb1\ufe0f Ver detalles",
"additionalFields": {
"url": "={{ $json.output.link }}"
}
}
]
}
}
]
},
"additionalFields": {
"appendAttribution": false,
"parse_mode": "HTML",
"message_thread_id": 26005
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-260,
-140
],
"id": "9b24ab77-c81e-4973-bc68-86efa6e2ce40",
"name": "Telegram",
"credentials": {
"telegramApi": {
"id": "XRxLwjG0J2NHRst1",
"name": "Greeg"
}
}
}
],
"pinData": {},
"connections": {
"Filter by name": {
"main": [
[
{
"node": "Basic LLM Chain",
"type": "main",
"index": 0
}
]
]
},
"RSS Feed Trigger": {
"main": [
[
{
"node": "Filter by name",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Basic LLM Chain",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Basic LLM Chain": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
}
},
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "8ccc6a95-97d3-4135-ad62-6689fc1cf2e8",
"meta": {
"instanceId": "33738330930e3881dd5571eca013f36ddf8aab20e4ea5c1f2ebaf4a2b4668ac6"
},
"id": "l1LAsnT0QGVzjVYJ",
"tags": []
}
${sectionTitle}
\\\\s*- (.*?)