Ready-made recipe · ai
Telegram → AI Agent → Telegram
An AI Agent answers each Telegram message, looking things up in Google Sheets when it needs to, and replies on Telegram.
Steps
- When when a telegram message comes in — Telegram node only reads
- Then answer it using google sheets as a tool — AI Agent node · may use: Google Sheets can be undone
- Then reply on telegram — Telegram node can’t be undone
Fields to fill (5)
The file has every node wired up. These are the blanks only you can fill (your form, your sheet, your words).
| Node | What to do |
|---|---|
| Telegram | fill chatId (Unique identifier for the target chat or username, To fin...) |
| Telegram | fill text (Text of the message to be sent) — the AI step's output: run that node once in n8n and pick its output field |
| OpenAI Chat Model | check model: OpenAI Chat Model chosen by default (most used) — swap for Gemini, Anthropic, Ollama … if you like |
| OpenAI Chat Model | fill model (The model) |
| Google Sheets tool | pick workflowId: a small workflow that does the Google Sheets part (Execute Workflow Trigger → the Google Sheets action(s) the agent may take); the node list we read (n8n 2.43.2) has no Google Sheets tool node to plug in directly |
Accounts to connect (4)
In n8n, pick or add a credential on each node — one of the types below.
- Telegram:
telegramApi - Telegram:
telegramApi - OpenAI Chat Model:
openAiApi - Google Sheets tool:
googleApiorgoogleSheetsOAuth2Api(in that small workflow)
- Run it on Apify — type your own sentence, get the workflow back in seconds. Open Bridgecore on Apify (pay per use, $0.02–$0.05; nothing charged on errors).
- Ask your AI — add the MCP server
https://mcp.usebridgecore.com/to Claude, Cursor or any MCP client, then just say what should happen. Tools:do,find_recipe,plan_automation,make_n8n_workflow. Free to plan. - Ask me first — add “and ask me first” to any step (“… and post it on X and ask me first”) and the workflow sends you an Approve / Decline message (Slack, Telegram or Gmail) before that step runs. Nothing is sent, posted, deleted or paid until you tap Approve; no answer in a day = declined.
Get the n8n file
Download telegram-agent-answers-from-sheets.json
- Open a new, empty workflow in n8n.
- Open the workflow menu (⋯) and choose Import from File — or copy the JSON below and paste it onto the canvas (Ctrl/Cmd+V).
- Connect the accounts, fill the fields above, run one test, then turn the workflow on.
Or copy the JSON
{
"name": "An AI Agent answers each Telegram message",
"nodes": [
{
"id": "n1",
"name": "Telegram Trigger",
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.5,
"parameters": {
"updates": [
"message"
]
},
"position": [
240,
300
],
"notes": "step: when a telegram message comes in · reversibility: read-only"
},
{
"id": "n2",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 3.1,
"parameters": {
"promptType": "define",
"text": "=Answer it:\n\n{{ JSON.stringify($json) }}"
},
"position": [
460,
300
],
"notes": "step: answer it using google sheets as a tool · reversibility: reversible"
},
{
"id": "n3",
"name": "Telegram",
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"parameters": {
"resource": "message",
"operation": "sendMessage",
"chatId": "",
"text": ""
},
"position": [
680,
300
],
"notes": "step: reply on telegram · reversibility: irreversible"
},
{
"id": "n4",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"typeVersion": 1.3,
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"position": [
460,
500
]
},
{
"id": "n5",
"name": "Google Sheets tool",
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 2.2,
"parameters": {
"description": "Call this to use Google Sheets.",
"workflowId": {
"__rl": true,
"mode": "list",
"value": ""
}
},
"position": [
640,
500
]
}
],
"connections": {
"Telegram Trigger": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Telegram",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Sheets tool": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
}
},
"settings": {
"executionOrder": "v1"
},
"active": false
}