workflows.fit
Back to n8n workflows
n8n templateFreeBy Yulia

Agentic Telegram AI bot with with LangChain nodes and new tools

Create a Telegram bot that combines advanced AI functionalities with LangChain nodes and new tools. [Nodes as tools](https://community.n8n.io/t/review-node-as-tools-is-finally-here/57539) and the [HTTP request tool](h...

CommunicationHITLAILangchainCore NodesLm Chat Open AiMemory Buffer WindowTelegram Trigger
Loading interactive preview...

Template notes

Create a Telegram bot that combines advanced AI functionalities with LangChain nodes and new tools.

[Nodes as tools](https://community.n8n.io/t/review-node-as-tools-is-finally-here/57539) and the [HTTP request tool](https://community.n8n.io/t/using-the-http-request-tool-with-ai-agents/50616/3) are a new n8n feature that extend [custom workflow tool](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.toolworkflow/) and simplify your setup. We used the workflow tool in the [previous Telegram template](https://n8n.io/workflows/2035-telegram-ai-bot-with-langchain-nodes/) to call the Dalle-3 model.

In the new version, we've achieved similar results using the HTTP Request tool and the Telegram node tool instead. The main difference is that Telegram bot becomes more flexible. The LangChain Agent node can decide which tool to use and when. In the previous version, all steps inside the custom workflow tool were executed sequentially.

⚠️ Note that you'd need to select the Tools Agent to work with new tools.

Before launching the template, make sure to set up your OpenAI and Telegram credentials.

Here’s how the new Telegram bot works:

1. Telegram Trigger listens for new messages in a specified Telegram chat. This node activates the rest of the workflow after receiving a message.

2. AI Tool Agent receives input text, processes it using the OpenAI model and replies to a user. It addresses users by name and sends image links when an image is requested.