AutomationFlowsAI & RAG › Build a Comprehensive Multimodal Assistant on Telegram with Openai, Serp and…

Build a Comprehensive Multimodal Assistant on Telegram with Openai, Serp and…

Original n8n title: Build a Comprehensive Multimodal Assistant on Telegram with Openai, Serp and Vector Store

ByFabioInTech @fabiointech on n8n.io

This 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…

Event trigger★★★★★ complexityAI-powered48 nodesTelegram TriggerTelegramMemory Buffer WindowOpenAIIn-Memory Vector StoreOpenAI EmbeddingsDocument Default Data LoaderText Splitter Token Splitter
AI & RAG Trigger: Event Nodes: 48 Complexity: ★★★★★ AI nodes: yes Added:
Build a Comprehensive Multimodal Assistant on Telegram with Openai, Serp and… — n8n workflow card showing Telegram Trigger, Telegram, Memory Buffer Window integration

This workflow corresponds to n8n.io template #6813 — we link there as the canonical source.

This workflow follows the Agent → Documentdefaultdataloader recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "X0hXjTBvKAyw79CG",
  "meta": {
    "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": "Receive Message",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -1072,
        -128
      ],
      "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": "Get Audio File",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -80,
        -240
      ],
      "parameters": {
        "fileId": "={{ $json.message.voice.file_id }}",
        "resource": "file"
      },
      "typeVersion": 1.2
    },
    {
      "id": "8220b2ee-2aff-4a0c-bb62-e618a2f644fe",
      "name": "Window Buffer Memory",
      "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": "Analyze Image",
      "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": "Fix File Extension",
      "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": "Text Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1648,
        -48
      ],
      "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": "Generate 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": "Audio Response",
      "type": "n8n-nodes-base.telegram",
      "position": [
        1648,
        128
      ],
      "parameters": {
        "chatId": "={{ $('Receive Message').item.json.message.chat.id }}",
        "operation": "sendAudio",
        "binaryData": true,
        "additionalFields": {}
      },
      "typeVersion": 1.2
    },
    {
      "id": "5d231620-f60b-470e-8140-c48d68692035",
      "name": "Download Image",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -224,
        -560
      ],
      "parameters": {
        "fileId": "={{ $json.message.photo[2].file_id }}",
        "resource": "file"
      },
      "typeVersion": 1.2
    },
    {
      "id": "d6853469-7d19-4252-af03-1f997730447b",
      "name": "Transcribe",
      "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": "Sticky Note1",
      "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": "Sticky Note4",
      "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": "Sticky Note5",
      "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": "Sticky Note7",
      "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": "Sticky Note10",
      "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": "Download Document",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -384,
        400
      ],
      "parameters": {
        "fileId": "={{ $json.message.document.file_id }}",
        "resource": "file"
      },
      "typeVersion": 1.2
    },
    {
      "id": "617f2112-d00f-4414-89ba-f6bb4df4e8b7",
      "name": "Format-text-output",
      "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": "Format-voice-output",
      "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": "Simple Vector Store",
      "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": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        -16,
        576
      ],
      "parameters": {
        "options": {},
        "dataType": "binary"
      },
      "typeVersion": 1
    },
    {
      "id": "99c41c20-03a2-40e1-8e22-f02bfb07db49",
      "name": "Token Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterTokenSplitter",
      "position": [
        320,
        592
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "b6c315a2-e08a-412f-b257-d0c9c911f101",
      "name": "Sticky Note11",
      "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": "Simple Vector Store1",
      "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": "Sticky Note12",
      "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### \ud83e\uddd1\u200d\ud83d\udcbb Who\u2019s it for\n\nThis workflow is for developers, AI enthusiasts, and businesses who want to create an advanced, interactive AI assistant on Telegram. It\u2019s 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### \u2699\ufe0f 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### \ud83d\udee0\ufe0f 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### \u2705 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### \ud83c\udfa8 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### \ud83d\udcac 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": "Sticky Note13",
      "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": "Image Generator",
      "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": "Basic Google Search",
      "type": "@n8n/n8n-nodes-langchain.toolSerpApi",
      "position": [
        1440,
        688
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "db28a3c3-404c-4ac4-ab53-583ecb7ac1c0",
      "name": "Webpage Scraper",
      "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": "Sticky Note14",
      "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": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        1936,
        688
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "f32e73b9-62f4-497b-84d2-2788f41f2a61",
      "name": "OpenAI Chat Model",
      "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": "Split 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": "Convert 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": "Format-doc-output",
      "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": "Format-image-output",
      "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": "Sticky Note",
      "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": "Sticky Note2",
      "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": "Sticky Note3",
      "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": "Sticky Note6",
      "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": "Sticky Note8",
      "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": "API Setup",
      "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": "Sticky Note9",
      "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,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bed988a3-5695-4f40-8078-55eacace7e83",
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "Download Image",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Get Audio File",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Format-text-output",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Download Document",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "API Setup": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Split MSG": {
      "main": [
        [
          {
            "node": "Text Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe": {
      "main": [
        [
          {
            "node": "Format-voice-output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Doc": {
      "main": [
        [
          {
            "node": "Simple Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "J.A.R.V.I.S.": {
      "main": [
        [
          {
            "node": "If Audio Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analyze Image": {
      "main": [
        [
          {
            "node": "Format-image-output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Download Image": {
      "main": [
        [
          {
            "node": "Fix File Extension",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Audio": {
      "main": [
        [
          {
            "node": "Audio Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Audio File": {
      "main": [
        [
          {
            "node": "Transcribe",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Token Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "Image Generator": {
      "ai_tool": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Receive Message": {
      "main": [
        [
          {
            "node": "API Setup",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webpage Scraper": {
      "ai_tool": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Download Document": {
      "main": [
        [
          {
            "node": "Convert Doc",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Simple Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Format-doc-output": {
      "main": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Audio Response": {
      "main": [
        [
          {
            "node": "Split MSG",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Generate Audio",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Simple Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Fix File Extension": {
      "main": [
        [
          {
            "node": "Analyze Image",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format-text-output": {
      "main": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Basic Google Search": {
      "ai_tool": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Simple Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Format-image-output": {
      "main": [
        [
          {
            "node": "Text Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format-voice-output": {
      "main": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Vector Store": {
      "main": [
        [
          {
            "node": "Format-doc-output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Simple Vector Store1": {
      "ai_tool": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Window Buffer Memory": {
      "ai_memory": [
        [
          {
            "node": "J.A.R.V.I.S.",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This 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…

Source: https://n8n.io/workflows/6813/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

A lightweight, self-hosted AI assistant built entirely in n8n. Multi-channel messaging (Telegram, WhatsApp, Gmail), persistent memory, task management, and autonomous work — all in a single visual wor

Telegram Trigger, OpenRouter Chat, Data Table +20
AI & RAG

This workflow implements an advanced AI automation agent (OpenClaw Agent) that interacts with users through Telegram and integrates multiple AI models, external tools, and cloud services to automate c

Telegram Trigger, Telegram, OpenAI +21
AI & RAG

Your AI workforce is ready. Are you?

Google Sheets Tool, Mcp Trigger, Google Drive +29
AI & RAG

This comprehensive workflow bundle is designed as a powerful starter kit, enabling you to build a multi-functional AI assistant on Telegram. It seamlessly integrates AI-powered voice interactions, an

Telegram Trigger, Telegram, OpenAI +19
AI & RAG

This intelligent chatbot leverages cutting-edge financial APIs and AI-driven analysis to deliver comprehensive stock research reports. Get instant access to professional-grade investment analysis that

Tool Think, Supabase Vector Store, OpenAI Embeddings +15