J.A.R.V.I.S.

Avanzado

Este es unSupport Chatbot, AI Chatbotflujo de automatización del dominio deautomatización que contiene 48 nodos.Utiliza principalmente nodos como If, Set, Code, Switch, Telegram. Construye un asistente multimodal completo en Telegram usando OpenAI, SERP y almacenamiento vectorial

Requisitos previos
  • Bot Token de Telegram
  • Clave de API de OpenAI
  • Pueden requerirse credenciales de autenticación para la API de destino
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "X0hXjTBvKAyw79CG",
  "meta": {
    "instanceId": "57c6ae2839a35415c47c2c780dda3195de041953069a0948855f595fc6dcad27",
    "templateCredsSetupCompleted": true
  },
  "name": "J.A.R.V.I.S.",
  "tags": [
    {
      "id": "7pJlw7HV4Rg9tAKm",
      "name": "Template",
      "createdAt": "2025-03-18T18:15:54.900Z",
      "updatedAt": "2025-03-18T18:15:54.900Z"
    }
  ],
  "nodes": [
    {
      "id": "63508f52-6a6c-4f50-a9d2-aa07841d212f",
      "name": "Recibir Mensaje",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1072,
        -128
      ],
      "webhookId": "",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "50b9c7ec-0a3a-417a-a670-a7172654e39c",
      "name": "Switch",
      "type": "n8n-nodes-base.switch",
      "position": [
        -512,
        -160
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "image",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "f6d0a607-e0ad-49ba-9987-10ad2889b536",
                    "operator": {
                      "type": "array",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.photo }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "voice",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "2a9d7a90-7f2e-4228-84df-6476a2534a04",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.voice.file_id }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "text",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "9c1228ec-7c48-4e0c-b4fb-deff09011f26",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.text }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            },
            {
              "outputKey": "document",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "81e3c68d-200d-4e5b-96b3-9993eb7c3d07",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "leftValue": "={{ $json.message.document.file_id }}",
                    "rightValue": ""
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "d36725d6-29d7-4876-8122-61868ba71327",
      "name": "Obtener Archivo de Audio",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -80,
        -240
      ],
      "webhookId": "",
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file"
      },
      "typeVersion": 1.2
    },
    {
      "id": "8220b2ee-2aff-4a0c-bb62-e618a2f644fe",
      "name": "Memoria de Búfer de Ventana",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        912,
        688
      ],
      "parameters": {
        "sessionKey": "={{ $('Receive Message').item.json.message.chat.id }}",
        "sessionIdType": "customKey",
        "contextWindowLength": 10
      },
      "typeVersion": 1.3
    },
    {
      "id": "bcd61ea3-908d-4689-8594-03d870332bcc",
      "name": "Analizar Imagen",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        144,
        -560
      ],
      "parameters": {
        "text": "={{ $('Receive Message').item.json.message.caption || \"Describe this image\" }}",
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini",
          "cachedResultName": "GPT-4O-MINI"
        },
        "options": {},
        "resource": "image",
        "inputType": "base64",
        "operation": "analyze"
      },
      "typeVersion": 1.8
    },
    {
      "id": "19ebb0e3-3f97-48f7-9867-0703e36a6e5a",
      "name": "Corregir Extensión de Archivo",
      "type": "n8n-nodes-base.code",
      "position": [
        -48,
        -560
      ],
      "parameters": {
        "jsCode": "const inputItem = items[0];\nconst extension = inputItem.binary.data.fileExtension;\ninputItem.binary.data.mimeType = `image/${extension}`;\nreturn inputItem;"
      },
      "typeVersion": 2
    },
    {
      "id": "ff400a23-1ee5-45bd-9ef3-a9bd1c1d99be",
      "name": "Respuesta de Texto",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1648,
        -48
      ],
      "webhookId": "",
      "parameters": {
        "text": "={{ JSON.stringify($json.output) }}",
        "chatId": "={{ $('Receive Message').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "edf1ab87-0583-408a-bc30-df4e945edc63",
      "name": "Generar Audio",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        1344,
        128
      ],
      "parameters": {
        "input": "={{ $json.output }}",
        "model": "=gpt-4o-mini-tts",
        "voice": "=echo",
        "options": {
          "speed": 0.9
        },
        "resource": "audio"
      },
      "typeVersion": 1.8
    },
    {
      "id": "4f76c567-0a62-4b7b-9143-a7464ba11b99",
      "name": "Respuesta de Audio",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1648,
        128
      ],
      "webhookId": "",
      "parameters": {
        "chatId": "={{ $('Receive Message').item.json.message.chat.id }}",
        "operation": "sendAudio",
        "binaryData": true,
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "5d231620-f60b-470e-8140-c48d68692035",
      "name": "Descargar Imagen",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -224,
        -560
      ],
      "webhookId": "",
      "parameters": {
        "fileId": "={{ $json.message.photo[2].file_id }}",
        "resource": "file"
      },
      "typeVersion": 1.2
    },
    {
      "id": "d6853469-7d19-4252-af03-1f997730447b",
      "name": "Transcribir",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        112,
        -240
      ],
      "parameters": {
        "options": {},
        "resource": "audio",
        "operation": "transcribe"
      },
      "typeVersion": 1.8
    },
    {
      "id": "14b5860f-c18f-4ff6-b3a9-6529d47abbef",
      "name": "Nota Adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -304,
        -656
      ],
      "parameters": {
        "color": 7,
        "width": 780,
        "height": 276,
        "content": "## 4. Image Chat\n- Analyze the image using [OpenAI Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/)"
      },
      "typeVersion": 1
    },
    {
      "id": "9e9f77b6-6e50-4b59-b8e9-5e65d0b03d8b",
      "name": "Nota Adhesiva4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1072,
        -144
      ],
      "parameters": {
        "color": 7,
        "width": 432,
        "height": 468,
        "content": "## 8. Handle Responses\nUsing [OpenAI Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/)\n\nIF Node split messages:\n- Audio\n- Text"
      },
      "typeVersion": 1
    },
    {
      "id": "9f597dc7-16c6-4921-b0b9-52d47e829eab",
      "name": "Nota Adhesiva5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        640,
        -144
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 448,
        "content": "## 8. J.A.R.V.I.S.\n### This is the Agent Main Brain\n- Using [AI Agent Node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)"
      },
      "typeVersion": 1
    },
    {
      "id": "4297a3eb-a7f6-4611-8ccc-80ed7d3ad26d",
      "name": "Nota Adhesiva7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1376,
        560
      ],
      "parameters": {
        "color": 7,
        "width": 420,
        "height": 332,
        "content": "## Search and Research Tools"
      },
      "typeVersion": 1
    },
    {
      "id": "52ad7010-62bd-4bf7-a183-863fde5d75b5",
      "name": "Nota Adhesiva10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -432,
        304
      ],
      "parameters": {
        "color": 7,
        "width": 904,
        "height": 428,
        "content": "## 7. Documment Chat\n- Download the Doc and store on a Vector Store for reference, using [Simple Vector Store Node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/)"
      },
      "typeVersion": 1
    },
    {
      "id": "073bbeff-843d-49b2-9bfb-2b8829270c4e",
      "name": "Descargar Documento",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -384,
        400
      ],
      "webhookId": "",
      "parameters": {
        "fileId": "={{ $json.message.document.file_id }}",
        "resource": "file"
      },
      "typeVersion": 1.2
    },
    {
      "id": "617f2112-d00f-4414-89ba-f6bb4df4e8b7",
      "name": "Formatear-salida-texto",
      "type": "n8n-nodes-base.set",
      "position": [
        208,
        96
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88cbdd27-f094-458b-878f-60504b8c3ad7",
              "name": "chat_input",
              "type": "string",
              "value": "={{ $json.message.text }}"
            },
            {
              "id": "def17956-a312-409b-874c-ebf4aea69427",
              "name": "type",
              "type": "string",
              "value": "text"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "3cb74d57-53eb-4133-ac0a-a2b8b5004e6c",
      "name": "Formatear-salida-voz",
      "type": "n8n-nodes-base.set",
      "position": [
        304,
        -240
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "88cbdd27-f094-458b-878f-60504b8c3ad7",
              "name": "chat_input",
              "type": "string",
              "value": "={{ $json.text }}"
            },
            {
              "id": "1c8414e4-8e4a-49e7-b255-79e0e8073e8f",
              "name": "type",
              "type": "string",
              "value": "voice"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "359149fe-ae86-4ee2-b87c-e131902f99fc",
      "name": "Almacén Vectorial Simple",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        -16,
        400
      ],
      "parameters": {
        "mode": "insert",
        "memoryKey": "=vector_store_key",
        "clearStore": true
      },
      "typeVersion": 1
    },
    {
      "id": "0ff81048-73bb-4d59-a38b-9b1769e6ae18",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        -160,
        576
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "908582d6-1145-4069-839e-192d348fda31",
      "name": "Cargador de Datos Predeterminado",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -16,
        576
      ],
      "parameters": {
        "options": {},
        "dataType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "99c41c20-03a2-40e1-8e22-f02bfb07db49",
      "name": "Separador por Tokens",
      "type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
      "position": [
        320,
        592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b6c315a2-e08a-412f-b257-d0c9c911f101",
      "name": "Nota Adhesiva11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        560
      ],
      "parameters": {
        "color": 7,
        "width": 480,
        "height": 432,
        "content": "## Temporary Memory"
      },
      "typeVersion": 1
    },
    {
      "id": "a71743b4-1bef-4e8a-a80c-11064d1fac05",
      "name": "Almacén Vectorial Simple1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreInMemory",
      "position": [
        608,
        688
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "toolName": "temporary_vectorstore",
        "toolDescription": "Use this tool to retrieve information about the documents uploaded in the messages.\nThis vector store is temporary and just keep the last document uploaded.",
        "includeDocumentMetadata": false
      },
      "typeVersion": 1
    },
    {
      "id": "51498ba1-251a-40a3-8df2-924a75d7e612",
      "name": "Nota Adhesiva12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1904,
        -688
      ],
      "parameters": {
        "width": 684,
        "height": 1588,
        "content": "## J.A.R.V.I.S.\n\n## Multimodal AI assistant on Telegram with OpenAI\n\nThis workflow transforms your Telegram bot into J.A.R.V.I.S., a powerful, multimodal AI assistant. It can understand and process text, voice messages, images, and documents. The assistant can search the web, scrape websites, generate images, perform calculations, and reference uploaded documents to provide comprehensive and context-aware responses in either text or audio format.\n\n### 🧑‍💻 Who’s it for\n\nThis workflow is for developers, AI enthusiasts, and businesses who want to create an advanced, interactive AI assistant on Telegram. It’s perfect for automating customer support, creating a personal AI helper, or exploring the capabilities of multimodal large language models (LLMs) in a practical application.\n\n### ⚙️ How it works\n\nThe workflow begins when a message is received by your Telegram bot. A Switch node then directs the data based on the message type:\n\n*   **Text:** The message is formatted and sent directly to the main AI agent.\n*   **Voice:** The audio file is downloaded from Telegram and transcribed into text using the OpenAI API.\n*   **Image:** The image is downloaded and analyzed by an OpenAI vision model to understand its content.\n*   **Document:** The file is downloaded and its content is stored in a temporary vector store, making it searchable for the AI.\n\nThe processed input is then passed to the core \"J.A.R.V.I.S.\" Agent node. This agent uses an OpenAI model, conversational memory, and a suite of tools (Google Search, Web Scraper, Image Generator, Calculator, and the document vector store) to formulate a response. Finally, the workflow checks if the initial message was a voice note; if so, it generates an audio response. Otherwise, it sends the answer as a text message back to the user.\n\n### 🛠️ How to set up\n\n1.  **Telegram:** \n  - Create a Telegram Bot - Use @BotFather to create a bot and obtain your bot token;\n  - Add Telegram API credentials in n8n with your bot token to the `Receive Message` Trigger node and all other Telegram nodes. In the `Receive Message` node, enter the `chatId` of the user or group authorized to interact with the bot.\n2.  **OpenAI:** Add your OpenAI API credentials to all OpenAI, AI Agent, and AI tool nodes.\n3.  **SerpAPI:** Add your SerpAPI credentials to the `Basic Google Search` node to enable web search functionality.\n4.  **Jina AI:** Add your Jina AI API key to the Setup Node - The API Key is used on the `Webpage Scraper` node.\n\n### ✅ Requirements\n\n*   Telegram Bot API credentials and Bot token.\n*   OpenAI API credentials.\n*   SerpAPI API credentials.\n*   Jina.ai API credentials\n\n### 🎨 How to customize the workflow\n\n*   **Change the AI model:** You can select a different OpenAI model in the `OpenAI Chat Model` node (e.g., switch from `gpt-4.1` to `gpt-4o`) or in the `Analyze Image` and `Transcribe` nodes.\n*   **Modify the AI's personality:** Edit the system prompt in the `J.A.R.V.I.S.` Agent node to change its name, tone, instructions, or default language.\n*   **Expand its tools:** Connect more tools to the `J.A.R.V.I.S.` Agent node to extend its capabilities, such as connecting to a database or another third-party API.\n*   **Adjust the response format:** Modify the `If Audio Response` node to change the conditions for sending text or audio messages. For example, you could configure it to always respond with text.\n\n### 💬 Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)"
      },
      "typeVersion": 1
    },
    {
      "id": "85d2c0b6-3c5e-4a94-8c21-932b1ceaac03",
      "name": "Nota Adhesiva13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        560
      ],
      "parameters": {
        "color": 7,
        "width": 216,
        "height": 324,
        "content": "## Image Tools"
      },
      "typeVersion": 1
    },
    {
      "id": "7862530b-1c57-468a-b5ea-5511cd1d4748",
      "name": "Generador de Imágenes",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        1168,
        688
      ],
      "parameters": {
        "url": "https://api.openai.com/v1/images/generations",
        "method": "POST",
        "jsonBody": "= {\n    \"model\": \"dall-e-3\",\n    \"prompt\": \"{prompt}\",\n    \"n\": 1,\n    \"size\": \"1024x1024\"\n  }",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "predefinedCredentialType",
        "toolDescription": "Use this tool to generate images. Its connected to OpenAI gpt-image-1.",
        "nodeCredentialType": "openAiApi",
        "placeholderDefinitions": {
          "values": [
            {
              "name": "=prompt",
              "description": "The image detailed description"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "6a2df6c7-32f4-49a5-80fb-77bac03a9216",
      "name": "Búsqueda Básica Google",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        1440,
        688
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "db28a3c3-404c-4ac4-ab53-583ecb7ac1c0",
      "name": "Rastreador de Páginas Web",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        1632,
        688
      ],
      "parameters": {
        "url": "=https://r.jina.ai/{url}",
        "sendHeaders": true,
        "toolDescription": "Use this tool to scrape a website.",
        "parametersHeaders": {
          "values": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $('API Setup').item.json.JINA_API }}",
              "valueProvider": "fieldValue"
            }
          ]
        },
        "placeholderDefinitions": {
          "values": [
            {
              "name": "url",
              "type": "string",
              "description": "=URL address to scrape"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "f1276dad-a291-435f-8397-12d29b06785f",
      "name": "Nota Adhesiva14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1856,
        560
      ],
      "parameters": {
        "color": 7,
        "width": 380,
        "height": 328,
        "content": "## Reasoning Tools"
      },
      "typeVersion": 1
    },
    {
      "id": "202ede45-5be3-421d-ba96-0f9880c7fdbe",
      "name": "Calculadora",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        1936,
        688
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f32e73b9-62f4-497b-84d2-2788f41f2a61",
      "name": "Modelo de Chat OpenAI",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        720,
        176
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "ae00f93e-3e7a-44c3-829f-b9dbc1013c24",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        2096,
        688
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b26aa56c-cfa6-4bf8-83dc-cebae07168b4",
      "name": "Dividir MSG",
      "type": "n8n-nodes-base.code",
      "position": [
        1344,
        -16
      ],
      "parameters": {
        "jsCode": "// In n8n, you can use a Code node to split long messages\nconst output = $input.first().json.output;\nconst maxLength = 3600; // Leave some buffer\nconst chunks = [];\n\nfor (let i = 0; i < output.length; i += maxLength) {\n    chunks.push(output.substring(i, i + maxLength));\n}\n\nreturn chunks.map(chunk => ({ json: { output: chunk } }));"
      },
      "typeVersion": 2
    },
    {
      "id": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
      "name": "J.A.R.V.I.S.",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        704,
        -16
      ],
      "parameters": {
        "text": "={{ $json.chat_input }}",
        "options": {
          "maxIterations": 10,
          "systemMessage": "=# ROLE\nYou are a helpful assistant.\nYour name is \"J.A.R.V.I.S.\". Response in a friendly and helpful tone.\nYour version is: 1.0\n\n# Important Information\nYou are speaking to {{ $('Switch').item.json.message.from.first_name }}\nCurrent date and time: {{ $now }}\nEnglish is your default language.\n\n# Tools avaliable to your use:\n\n## Think\nBefore taking any action or responding to the user after receiving tool results, use the Think tool as a scratchpad to:\n- List the specific rules that apply to the current request\n- Check if all required information is collected\n- Verify that the planned action complies with all policies\n- Iterate over tool results for correctness\n\n## Search and Research tools:\n- Basic Google Search;\n- Webpage Scraper;\n\n## Reasoning tools:\n- Calculator.\n\n## Image tools:\n- Image Generator.\n\n## temporary_vectorstore\nUse to get information from the document uploaded (if any).\n\n# Important: \n- Do not atempt to perform a task by yourself, always call the appropriate tool to perform the task\n- Always inform a list of tools you used at the end of your message (e.g., Get Emails, Webpage Scraper...).\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.7
    },
    {
      "id": "2995104c-a593-4929-b222-99fde8338880",
      "name": "Convertir Doc",
      "type": "n8n-nodes-base.code",
      "position": [
        -208,
        400
      ],
      "parameters": {
        "jsCode": "const inputItem = items[0];\n// const extension = inputItem.binary.data.fileExtension;\n// inputItem.binary.data.mimeType = `text/${extension}`;\n// inputItem.binary.data.mimeType = `text/plain`;\ninputItem.binary.data.mimeType = $('Receive Message').first().json.message.document.mime_type;\nreturn inputItem;"
      },
      "typeVersion": 2
    },
    {
      "id": "95c5a72a-398d-456e-b8d4-06659958bf1f",
      "name": "Formatear-salida-doc",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        400
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "c2b1117f-9ae9-4ab6-86d1-df865a9a567c",
              "name": "chat_input",
              "type": "string",
              "value": "=A document type {{ $json.metadata.blobType }} was input and added to the temporary_vectorstore.\nThe caption (if any) sent with the document is:\n<caption>\n{{ $('Receive Message').item.json.message.caption }}\n</caption>\n\n"
            },
            {
              "id": "a7ec26a5-c8bc-429c-94b1-279e44ea133d",
              "name": "type",
              "type": "string",
              "value": "document"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "59b7a5c4-49ac-4b9e-b239-909fc4a2a4fb",
      "name": "Formatear-salida-imagen",
      "type": "n8n-nodes-base.set",
      "position": [
        320,
        -560
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "ec3a884f-480f-4462-9437-a7de0faed372",
              "name": "output",
              "type": "string",
              "value": "={{ $json.content }}"
            },
            {
              "id": "026bf7c8-16dd-490d-980a-f3c9a174b474",
              "name": "type",
              "type": "string",
              "value": "image"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "080384b3-57f7-4025-9c3f-70bd499356f2",
      "name": "If Audio Response",
      "type": "n8n-nodes-base.if",
      "position": [
        1120,
        64
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "3d8b9900-fe93-48d3-a1cf-8fd70542f091",
              "operator": {
                "type": "string",
                "operation": "notExists",
                "singleValue": true
              },
              "leftValue": "={{ $('Receive Message').item.json.message.voice.file_id }}",
              "rightValue": ""
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6f74a5e4-e4a3-42e6-bf04-745b3bb60e83",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        704,
        832
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "2a979273-c9c2-47fc-aa2e-fa621677415f",
      "name": "Nota Adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -592,
        -384
      ],
      "parameters": {
        "color": 7,
        "width": 252,
        "height": 468,
        "content": "## 3. Switch by the kind of message:\n- Text\n- Voice\n- Image\n- Document "
      },
      "typeVersion": 1
    },
    {
      "id": "d6eaff16-7af8-41ca-8492-294ebee80bd6",
      "name": "Nota Adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -336
      ],
      "parameters": {
        "color": 7,
        "width": 636,
        "height": 276,
        "content": "## 5. Audio Chat\n- Transcribe the audio using [OpenAI Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/)"
      },
      "typeVersion": 1
    },
    {
      "id": "4c705ae5-eab7-40e2-a301-1b33f4072c1f",
      "name": "Nota Adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        48,
        -16
      ],
      "parameters": {
        "color": 7,
        "width": 428,
        "height": 276,
        "content": "## 6. Text Chat\n- Format the text using [Set Node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.set/)"
      },
      "typeVersion": 1
    },
    {
      "id": "4b8836f3-116a-482a-865b-fb8716c40452",
      "name": "Nota Adhesiva6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        -144
      ],
      "parameters": {
        "color": 7,
        "width": 336,
        "height": 468,
        "content": "## 9. Send Responses\nUsing [Telegram Node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.telegram/)"
      },
      "typeVersion": 1
    },
    {
      "id": "69135c9f-fb55-4f58-bf70-991835bc3f8f",
      "name": "Nota Adhesiva8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1136,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 356,
        "content": "## 1. Input message:"
      },
      "typeVersion": 1
    },
    {
      "id": "0cd4e2ff-d13e-4f67-9e1d-fcfb3b5b8dd6",
      "name": "Configuración API",
      "type": "n8n-nodes-base.set",
      "position": [
        -800,
        -128
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "d2a919fc-1437-40aa-aa28-6136fbc4dee1",
              "name": "JINA_API",
              "type": "string",
              "value": ""
            }
          ]
        },
        "includeOtherFields": true
      },
      "typeVersion": 3.4
    },
    {
      "id": "a7a4d2a8-8b66-49f2-bf4b-ee035a7338a1",
      "name": "Nota Adhesiva9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -864,
        -272
      ],
      "parameters": {
        "color": 7,
        "width": 220,
        "height": 356,
        "content": "## 2. Set API Keys\n- Set Jina API"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bed988a3-5695-4f40-8078-55eacace7e83",
  "connections": {
    "ae00f93e-3e7a-44c3-829f-b9dbc1013c24": {
      "ai_tool": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "50b9c7ec-0a3a-417a-a670-a7172654e39c": {
      "main": [
        [
          {
            "node": "5d231620-f60b-470e-8140-c48d68692035",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "d36725d6-29d7-4876-8122-61868ba71327",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "617f2112-d00f-4414-89ba-f6bb4df4e8b7",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "073bbeff-843d-49b2-9bfb-2b8829270c4e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "0cd4e2ff-d13e-4f67-9e1d-fcfb3b5b8dd6": {
      "main": [
        [
          {
            "node": "50b9c7ec-0a3a-417a-a670-a7172654e39c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "b26aa56c-cfa6-4bf8-83dc-cebae07168b4": {
      "main": [
        [
          {
            "node": "ff400a23-1ee5-45bd-9ef3-a9bd1c1d99be",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "202ede45-5be3-421d-ba96-0f9880c7fdbe": {
      "ai_tool": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "d6853469-7d19-4252-af03-1f997730447b": {
      "main": [
        [
          {
            "node": "3cb74d57-53eb-4133-ac0a-a2b8b5004e6c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2995104c-a593-4929-b222-99fde8338880": {
      "main": [
        [
          {
            "node": "359149fe-ae86-4ee2-b87c-e131902f99fc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "06cac788-c7b3-4867-bae6-7bf847bbbccc": {
      "main": [
        [
          {
            "node": "080384b3-57f7-4025-9c3f-70bd499356f2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "bcd61ea3-908d-4689-8594-03d870332bcc": {
      "main": [
        [
          {
            "node": "59b7a5c4-49ac-4b9e-b239-909fc4a2a4fb",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "5d231620-f60b-470e-8140-c48d68692035": {
      "main": [
        [
          {
            "node": "19ebb0e3-3f97-48f7-9867-0703e36a6e5a",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "edf1ab87-0583-408a-bc30-df4e945edc63": {
      "main": [
        [
          {
            "node": "4f76c567-0a62-4b7b-9143-a7464ba11b99",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "d36725d6-29d7-4876-8122-61868ba71327": {
      "main": [
        [
          {
            "node": "d6853469-7d19-4252-af03-1f997730447b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "99c41c20-03a2-40e1-8e22-f02bfb07db49": {
      "ai_textSplitter": [
        [
          {
            "node": "908582d6-1145-4069-839e-192d348fda31",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "7862530b-1c57-468a-b5ea-5511cd1d4748": {
      "ai_tool": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "63508f52-6a6c-4f50-a9d2-aa07841d212f": {
      "main": [
        [
          {
            "node": "0cd4e2ff-d13e-4f67-9e1d-fcfb3b5b8dd6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "db28a3c3-404c-4ac4-ab53-583ecb7ac1c0": {
      "ai_tool": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "073bbeff-843d-49b2-9bfb-2b8829270c4e": {
      "main": [
        [
          {
            "node": "2995104c-a593-4929-b222-99fde8338880",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6f74a5e4-e4a3-42e6-bf04-745b3bb60e83": {
      "ai_embedding": [
        [
          {
            "node": "a71743b4-1bef-4e8a-a80c-11064d1fac05",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "95c5a72a-398d-456e-b8d4-06659958bf1f": {
      "main": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "080384b3-57f7-4025-9c3f-70bd499356f2": {
      "main": [
        [
          {
            "node": "b26aa56c-cfa6-4bf8-83dc-cebae07168b4",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "edf1ab87-0583-408a-bc30-df4e945edc63",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "f32e73b9-62f4-497b-84d2-2788f41f2a61": {
      "ai_languageModel": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "0ff81048-73bb-4d59-a38b-9b1769e6ae18": {
      "ai_embedding": [
        [
          {
            "node": "359149fe-ae86-4ee2-b87c-e131902f99fc",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "19ebb0e3-3f97-48f7-9867-0703e36a6e5a": {
      "main": [
        [
          {
            "node": "bcd61ea3-908d-4689-8594-03d870332bcc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "617f2112-d00f-4414-89ba-f6bb4df4e8b7": {
      "main": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6a2df6c7-32f4-49a5-80fb-77bac03a9216": {
      "ai_tool": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "908582d6-1145-4069-839e-192d348fda31": {
      "ai_document": [
        [
          {
            "node": "359149fe-ae86-4ee2-b87c-e131902f99fc",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "59b7a5c4-49ac-4b9e-b239-909fc4a2a4fb": {
      "main": [
        [
          {
            "node": "ff400a23-1ee5-45bd-9ef3-a9bd1c1d99be",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3cb74d57-53eb-4133-ac0a-a2b8b5004e6c": {
      "main": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "359149fe-ae86-4ee2-b87c-e131902f99fc": {
      "main": [
        [
          {
            "node": "95c5a72a-398d-456e-b8d4-06659958bf1f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a71743b4-1bef-4e8a-a80c-11064d1fac05": {
      "ai_tool": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "8220b2ee-2aff-4a0c-bb62-e618a2f644fe": {
      "ai_memory": [
        [
          {
            "node": "06cac788-c7b3-4867-bae6-7bf847bbbccc",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿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 soporte, Chatbot de IA

¿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.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos48
Categoría2
Tipos de nodos19
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Autor
FabioInTech

FabioInTech

@fabiointech

AI Systems Architect with 18+ years experience designing scalable, intelligent automation solutions. I specialize in architecting complex n8n workflows that integrate AI systems, streamline operations, and optimize business processes. My expertise spans multi-agent architectures, data automation, and enterprise-grade systems that adapt to evolving business needs. I help organizations unlock their potential through strategic technology implementation and innovative automation solutions.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34