Get Colombian Peso to USD Exchange Rate with Telegram Bot and AI Date Recognition

Go to Workflow
210 views
Built by Juan Sanchez Juan Sanchez
Created on June 08, 2026

Description

📌 Request TRM (Colombian Peso to US Dollar exchange rate)

🎯 Objective

Retrieve the TRM (Colombian Peso to US Dollar exchange rate) for a specific date provided by the user via Telegram.

🔄 Summary Flow

📨 Telegram Message
The user sends a text or audio message to the Telegram Bot.

🧠 Date Extraction
AI (OpenAI) is used to identify the date in YYYY-MM-DD format.

📅 Validation
If the date is in the future, the user is notified that it is not valid.

📡 TRM Query
The bot queries the open data API from the Colombian government.

📥 Result
✅ If TRM data exists for that date → The bot replies to the user.
❌ If not → It searches up to 10 previous days for available data.

📤 Final Response
The most recent available value is sent, or a message indicating no information is available.

🔗 Data Source

datos.gov.co – TRM

Nodes Used (9)

AI Agent
@n8n/n8n-nodes-langchain.agent
Calculator
@n8n/n8n-nodes-langchain.toolCalculator
Code
n8n-nodes-base.code
HTTP Request
n8n-nodes-base.httpRequest
OpenAI
@n8n/n8n-nodes-langchain.openAi
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured
Telegram
n8n-nodes-base.telegram
Think Tool
@n8n/n8n-nodes-langchain.toolThink