This workflow follows the Google Sheets → OpenAI 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 →
{
"name": "ai_content_summarizer_v1",
"nodes": [
{
"parameters": {
"updates": [
"message"
],
"additionalFields": {}
},
"type": "n8n-nodes-base.telegramTrigger",
"typeVersion": 1.3,
"position": [
-1024,
-272
],
"id": "17f25949-0620-405e-a18a-9efd90016735",
"name": "Telegram Trigger",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"modelId": {
"__rl": true,
"value": "gpt-4o-mini",
"mode": "list",
"cachedResultName": "GPT-4O-MINI"
},
"responses": {
"values": [
{
"content": "={{ $json.message.text }}"
},
{
"role": "system",
"content": "\u0422\u044b \u2014 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043d\u0442 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0435\u043a\u0441\u0442\u043e\u0432.\n\n\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u043b\u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442.\n\n\u0422\u0432\u043e\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2014 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0422\u041e\u041b\u042c\u041a\u041e \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 JSON \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0439, \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0439 \u0438 markdown-\u0431\u043b\u043e\u043a\u043e\u0432. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 JSON.\n\n\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u0442\u0432\u0435\u0442\u0430:\n{\n \"summary\": \"\u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u0440\u0435\u0437\u044e\u043c\u0435 \u0432 2-3 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445\",\n \"key_points\": [\"\u0442\u0435\u0437\u0438\u0441 1\", \"\u0442\u0435\u0437\u0438\u0441 2\", \"\u0442\u0435\u0437\u0438\u0441 3\"],\n \"category\": \"\u043e\u0434\u043d\u043e \u0441\u043b\u043e\u0432\u043e \u0438\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u0430\u044f \u0444\u0440\u0430\u0437\u0430\"\n}"
}
]
},
"builtInTools": {},
"options": {
"textFormat": {
"textOptions": {
"type": "json_object"
}
}
}
},
"type": "@n8n/n8n-nodes-langchain.openAi",
"typeVersion": 2.3,
"position": [
-400,
-48
],
"id": "d4939971-dd39-4f6e-a567-efaa9cc32d7d",
"name": "OpenAI_model",
"retryOnFail": true,
"waitBetweenTries": 2000,
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"onError": "continueRegularOutput"
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "f03198fa-c954-4f68-87ec-2923df659d5c",
"name": "summary",
"value": "={{ $json.output[0].content[0].text.summary }}",
"type": "string"
},
{
"id": "dfa0fbbf-296c-4f8f-8727-c63aa85e10eb",
"name": "key_points",
"value": "={{ $json.output[0].content[0].text.key_points }}",
"type": "array"
},
{
"id": "0215cc5d-7e30-42dd-baae-cf4ec360184a",
"name": "category",
"value": "={{ $json.output[0].content[0].text.category }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
192,
-48
],
"id": "68201d28-4f08-4dc7-8c0e-eaf747af11b2",
"name": "Edit Fields"
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "\u041f\u0440\u0438\u0448\u043b\u0438 \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 (\u043c\u0438\u043d\u0438\u043c\u0443\u043c 100 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432)",
"additionalFields": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-560,
128
],
"id": "2303ce40-c75c-429d-99a1-0ee9f0a1cdc3",
"name": "Telega_message_false",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "=\ud83d\udcc4 *\u0420\u0435\u0437\u044e\u043c\u0435:*\n{{ $json.summary }}\n\n\ud83d\udd11 *\u041a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0442\u0435\u0437\u0438\u0441\u044b:*\n{{ $json.key_points.map(p => '\u2022 ' + p).join('\\n') }}\n\n\ud83c\udff7 *\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f:* {{ $json.category }}",
"additionalFields": {
"appendAttribution": false,
"parse_mode": "Markdown"
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
464,
-48
],
"id": "01b46b17-ad64-4e3f-8e66-c830f12df5c8",
"name": "Telegram_message_true",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "\u26a0\ufe0f \u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439 \u0435\u0449\u0451 \u0440\u0430\u0437 \u0447\u0435\u0440\u0435\u0437 \u043c\u0438\u043d\u0443\u0442\u0443.",
"additionalFields": {}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
64,
128
],
"id": "b374f8b1-a63b-4221-ba01-1add0f73c58b",
"name": "Telegram_error",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "da58c901-c2f7-490e-acc2-9c93da602911",
"leftValue": "={{ $json.message.text }}",
"rightValue": "/history",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
},
{
"id": "8ecbaf09-08e0-49f3-bb0b-dbec777bd7cf",
"leftValue": "={{ $json.message.text }}",
"rightValue": "/start",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
},
{
"id": "213625af-b3de-4a32-b291-d69319a52b73",
"leftValue": "={{ $json.message.text }}",
"rightValue": "/help",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "or"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
-816,
-272
],
"id": "ba2dd4e3-4388-4d17-9cfe-3686b5827b1b",
"name": "IF_router"
},
{
"parameters": {
"authentication": "serviceAccount",
"documentId": {
"__rl": true,
"value": "1EdoBw6DA8Z7ZS5GjUZjQC6Yhqlh7noskHEvxFt-A7n8",
"mode": "list",
"cachedResultName": "ai_content_summarizer_log",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1EdoBw6DA8Z7ZS5GjUZjQC6Yhqlh7noskHEvxFt-A7n8/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1EdoBw6DA8Z7ZS5GjUZjQC6Yhqlh7noskHEvxFt-A7n8/edit#gid=0"
},
"options": {
"returnFirstMatch": false
}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.7,
"position": [
-480,
-464
],
"id": "29884109-39ab-46d7-97c2-1d4199c581bf",
"name": "Sheets_read_history",
"credentials": {
"googleApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"jsCode": "const rows = $input.all();\nconst last5 = rows.slice(-5);\n\nconst text = last5.map((row, i) => {\n const d = row.json;\n const date = d.timestamp ? d.timestamp.substring(0, 10) : '\u2014';\n return `${i + 1}. [${date}] ${d.category || '\u2014'}\\n${d.summary || '\u2014'}`;\n}).join('\\n\\n');\n\nreturn [{ json: { history_text: '\ud83d\udccb *\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b:*\\n\\n' + text } }];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-272,
-464
],
"id": "b6903f21-bbdc-4741-b0ef-731d729d3f29",
"name": "Code"
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "={{ $json.history_text }}",
"additionalFields": {
"appendAttribution": false,
"parse_mode": "Markdown"
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-48,
-464
],
"id": "86fdf90c-f536-41c1-afab-e90ea054d81f",
"name": "Telegram_history",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "b24ae3b5-a10f-43dd-9329-fc602bddcd5d",
"leftValue": "={{ $json.message.text.length }}",
"rightValue": 100,
"operator": {
"type": "number",
"operation": "gt"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
-672,
-48
],
"id": "87e88124-caa5-4b7d-9fbc-e1a91f03fd66",
"name": "If_1"
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "771180ab-b8a0-460a-885a-e2f829c692aa",
"leftValue": "={{ $json.error.message }}",
"rightValue": "",
"operator": {
"type": "string",
"operation": "empty",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
-80,
-16
],
"id": "1710330d-e39d-4c72-942e-bc305c66a5b1",
"name": "If_2"
},
{
"parameters": {
"authentication": "serviceAccount",
"operation": "append",
"documentId": {
"__rl": true,
"value": "1EdoBw6DA8Z7ZS5GjUZjQC6Yhqlh7noskHEvxFt-A7n8",
"mode": "list",
"cachedResultName": "ai_content_summarizer_log",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1EdoBw6DA8Z7ZS5GjUZjQC6Yhqlh7noskHEvxFt-A7n8/edit?usp=drivesdk"
},
"sheetName": {
"__rl": true,
"value": "gid=0",
"mode": "list",
"cachedResultName": "\u041b\u0438\u0441\u04421",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1EdoBw6DA8Z7ZS5GjUZjQC6Yhqlh7noskHEvxFt-A7n8/edit#gid=0"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"timestamp": "={{ $now.toISO() }}",
"source_text": "={{ $('Telegram Trigger').item.json.message.text }}",
"summary": "={{ $('Edit Fields').item.json.summary }}",
"category": "={{ $('Edit Fields').item.json.category }}"
},
"matchingColumns": [],
"schema": [
{
"id": "timestamp",
"displayName": "timestamp",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "source_text",
"displayName": "source_text",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "summary",
"displayName": "summary",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
},
{
"id": "category",
"displayName": "category",
"required": false,
"defaultMatch": false,
"display": true,
"type": "string",
"canBeUsedToMatch": true
}
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {}
},
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.7,
"position": [
672,
-48
],
"id": "87c9bb2c-3dc0-47fc-9acf-ff0f13101131",
"name": "Google_sheet_save",
"credentials": {
"googleApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "strict",
"version": 3
},
"conditions": [
{
"id": "b438a4ec-26ad-417e-a49b-c4bc5289dcb9",
"leftValue": "={{ $json.message.text }}",
"rightValue": "/history",
"operator": {
"type": "string",
"operation": "equals",
"name": "filter.operator.equals"
}
}
],
"combinator": "and"
},
"options": {}
},
"type": "n8n-nodes-base.if",
"typeVersion": 2.3,
"position": [
-608,
-272
],
"id": "b08ccc84-d5f4-4bcd-be2f-4e1a8b3128ab",
"name": "IF_commands"
},
{
"parameters": {
"chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
"text": "\ud83d\udc4b *\u0414\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c!* \u042f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u044b \u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AI. *\u041a\u043e\u043c\u0430\u043d\u0434\u044b:* /start \u2014 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 /help \u2014 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 /history \u2014 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 5 \u0430\u043d\u0430\u043b\u0438\u0437\u043e\u0432 *\u041a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:* \u041e\u0442\u043f\u0440\u0430\u0432\u044c \u0442\u0435\u043a\u0441\u0442 \u0441\u0442\u0430\u0442\u044c\u0438 (\u043c\u0438\u043d\u0438\u043c\u0443\u043c 100 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432) \u0438 \u043f\u043e\u043b\u0443\u0447\u0438 \u0440\u0435\u0437\u044e\u043c\u0435, \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0442\u0435\u0437\u0438\u0441\u044b \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e \u0442\u0435\u043c\u044b.",
"additionalFields": {
"appendAttribution": false,
"parse_mode": "Markdown"
}
},
"type": "n8n-nodes-base.telegram",
"typeVersion": 1.2,
"position": [
-368,
-256
],
"id": "d617af6a-60a3-4c14-8488-85697359120e",
"name": "Telegram_commands",
"credentials": {
"telegramApi": {
"name": "<your credential>"
}
}
}
],
"connections": {
"Telegram Trigger": {
"main": [
[
{
"node": "IF_router",
"type": "main",
"index": 0
}
]
]
},
"OpenAI_model": {
"main": [
[
{
"node": "If_2",
"type": "main",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Telegram_message_true",
"type": "main",
"index": 0
}
]
]
},
"Telegram_message_true": {
"main": [
[
{
"node": "Google_sheet_save",
"type": "main",
"index": 0
}
]
]
},
"IF_router": {
"main": [
[
{
"node": "IF_commands",
"type": "main",
"index": 0
}
],
[
{
"node": "If_1",
"type": "main",
"index": 0
}
]
]
},
"Sheets_read_history": {
"main": [
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Telegram_history",
"type": "main",
"index": 0
}
]
]
},
"If_1": {
"main": [
[
{
"node": "OpenAI_model",
"type": "main",
"index": 0
}
],
[
{
"node": "Telega_message_false",
"type": "main",
"index": 0
}
]
]
},
"If_2": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
],
[
{
"node": "Telegram_error",
"type": "main",
"index": 0
}
]
]
},
"IF_commands": {
"main": [
[
{
"node": "Sheets_read_history",
"type": "main",
"index": 0
}
],
[
{
"node": "Telegram_commands",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"binaryMode": "separate"
},
"versionId": "0f1c9fd6-1a98-4946-8278-cf68915abecb",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "fTfywH7ivWyUVUhI",
"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.
googleApiopenAiApitelegramApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
ai_content_summarizer_v1. Uses telegramTrigger, openAi, telegram, googleSheets. Event-driven trigger; 15 nodes.
Source: https://github.com/anton-automation/ai-content-summarizer/blob/main/ai_content_summarizer_v1.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Clone_Viral_TikToks_with_AI_Avatars___Auto_Post_to_9_Platforms_using_Perplexity___Blotato. Uses httpRequest, telegramTrigger, openAi, googleSheets. Event-driven trigger; 42 nodes.
1-Clone_Viral_TikToks_with_AI_Avatars___Auto_Post_to_9_Platforms_using_Perplexity___Blotato. Uses httpRequest, telegramTrigger, openAi, googleSheets. Event-driven trigger; 42 nodes.
1-Clone_Viral_TikToks_with_AI_Avatars___Auto_Post_to_9_Platforms_using_Perplexity___Blotato. Uses httpRequest, telegramTrigger, openAi, googleSheets. Event-driven trigger; 42 nodes.
1-Clone_Viral_TikToks_with_AI_Avatars___Auto_Post_to_9_Platforms_using_Perplexity___Blotato. Uses httpRequest, telegramTrigger, openAi, googleSheets. Event-driven trigger; 42 nodes.
💥Clone a viral TikTok and auto-post it to 9 platforms using Perplexity & Blotato vide. Uses httpRequest, telegramTrigger, openAi, googleSheets. Event-driven trigger; 41 nodes.