AutomationFlowsAI & RAG › Tavily Search Agent

Tavily Search Agent

Tavily search agent. Uses telegramTrigger, agent, lmChatOpenAi, memoryBufferWindow. Event-driven trigger; 6 nodes.

Event trigger★★☆☆☆ complexityAI-powered6 nodesTelegram TriggerAgentOpenAI ChatMemory Buffer WindowTelegram@Tavily/N8N Nodes Tavily
AI & RAG Trigger: Event Nodes: 6 Complexity: ★★☆☆☆ AI nodes: yes Added:

This workflow follows the Agent → OpenAI Chat 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
{
  "name": "Tavily search agent",
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.5,
      "position": [
        0,
        0
      ],
      "id": "d165283d-fb0c-4651-a6f3-03fd3357a9b7",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.message.text }}",
        "options": {
          "systemMessage": "You are a Smart Research Agent equipped with the Tavily search tool. Your main responsibility is to search the web using Tavily whenever accurate, factual, or up-to-date information is needed.\n\n### SYSTEM INSTRUCTIONS & BEHAVIOR RULES:\n\n1. TOOL USAGE (Tavily):\n   - You MUST use the Tavily tool whenever the user asks a question that requires searching the web, looking up facts, fetching current news, or researching any topic.\n   - Do NOT try to answer from your internal knowledge if the prompt requires factual accuracy or recent information; always call Tavily first.\n\n2. CASUAL CONVERSATION:\n   - For simple greetings, standard pleasantries, or basic social chat that does NOT require research, respond directly without calling Tavily.\n\n3. OUT OF SCOPE / NO INFORMATION:\n   - If the user asks for personal advice, medical/legal opinions, illegal tasks, or if the Tavily search yields no useful results, respond politely indicating that you don't have this information or that it falls outside your role.\n\n4. LANGUAGE & TONE:\n   - You MUST respond strictly in Egyptian Colloquial Arabic (\u0627\u0644\u0639\u0627\u0645\u064a\u0629 \u0627\u0644\u0645\u0635\u0631\u064a\u0629).\n   - Maintain a friendly, polite, helpful, and professional tone at all times.\n\n5. OUTPUT FORMATTING & NO SOURCES:\n   - Do NOT mention sources, links, or where the information came from at the end of sentences or responses.\n   - Present the information clearly, concisely, and neatly.\n   - Use double line breaks (a blank line) between every sentence/point to ensure the output is well-spaced and easy to read."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3.1,
      "position": [
        288,
        0
      ],
      "id": "05306f65-e8e1-404c-88c8-c6b310e88cc5",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-5-mini"
        },
        "builtInTools": {},
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.3,
      "position": [
        144,
        240
      ],
      "id": "320fdca1-c6c7-4e6f-945a-75ab54780f18",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "sessionIdType": "customKey",
        "sessionKey": "={{ $json.message.chat.id }}",
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.4,
      "position": [
        368,
        240
      ],
      "id": "fe172bb5-1874-4d5b-8271-f25f87e3b116",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "chatId": "1780804448",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        688,
        0
      ],
      "id": "c835fa6d-9b4f-4488-aef9-35318f43c33b",
      "name": "Send a text message",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "query": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Query', ``, 'string') }}",
        "options": {}
      },
      "type": "@tavily/n8n-nodes-tavily.tavilyTool",
      "typeVersion": 1,
      "position": [
        608,
        256
      ],
      "id": "94aa601c-bd45-4c7d-8efb-c04c320dac91",
      "name": "Search in Tavily",
      "credentials": {
        "tavilyApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "Send a text message",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search in Tavily": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1",
    "binaryMode": "separate",
    "availableInMCP": false
  },
  "versionId": "0e1a3da9-c30f-4f05-b82e-6ad5469f3aa7",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "nodeGroups": [],
  "id": "BvegKi8mySdSKNCW",
  "tags": []
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

Tavily search agent. Uses telegramTrigger, agent, lmChatOpenAi, memoryBufferWindow. Event-driven trigger; 6 nodes.

Source: https://github.com/alaaoka23/n8n-automations/blob/main/tavily-search-agent/workflow-v1.json — 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

Tavily search agent (upgrade). Uses telegramTrigger, agent, lmChatOpenAi, memoryBufferWindow. Event-driven trigger; 9 nodes.

Telegram Trigger, Agent, OpenAI Chat +3
AI & RAG

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

Agent, Telegram Trigger, OpenAI +4
AI & RAG

This workflow is perfect for anyone who wants to receive AI-powered research summaries directly on Telegram. Ideal for people asking frequent product, tech, or decision-making questions and want up-to

Agent, Lm Chat Deep Seek, Memory Buffer Window +4
AI & RAG

QuantumDefender AI is a next-generation intelligent cybersecurity assistant designed to harness the symbolic strength of quantum computing’s promise alongside cutting-edge AI capabilities. This sophis

OpenAI Chat, Agent, Memory Buffer Window +7
AI & RAG

This workflow triggers on Telegram updates, analyzes messages with an AI Agent using MCP tools, and sends notifications via Gmail and Telegram.

OpenAI Chat, N8N Nodes Mcp, Memory Buffer Window +4